Files
jitsi-meet/react/features/polls/components/native/PollItem.js
Saúl Ibarra Corretgé 8f1a7d52d2 fix(rn,build) fix use of "bare" relative path
The Metro bundler gets confused and the result of such import statements
is `undefined`.
2022-01-21 10:20:20 +01:00

41 lines
836 B
JavaScript

// @flow
import React from 'react';
import { View } from 'react-native';
import { useSelector } from 'react-redux';
import { shouldShowResults } from '../../functions';
import PollAnswer from './PollAnswer';
import PollResults from './PollResults';
import { chatStyles } from './styles';
type Props = {
/**
* Id of the poll.
*/
pollId: string,
}
const PollItem = ({ pollId }: Props) => {
const showResults = useSelector(shouldShowResults(pollId));
return (
<View
style = { chatStyles.pollItemContainer }>
{ showResults
? <PollResults
key = { pollId }
pollId = { pollId } />
: <PollAnswer
pollId = { pollId } />
}
</View>
);
};
export default PollItem;