diff --git a/app/soapbox/components/poll.tsx b/app/soapbox/components/poll.tsx index 4b0628d2d..52518172e 100644 --- a/app/soapbox/components/poll.tsx +++ b/app/soapbox/components/poll.tsx @@ -8,7 +8,7 @@ import { useDispatch } from 'react-redux'; import { openModal } from 'soapbox/actions/modals'; import { vote, fetchPoll } from 'soapbox/actions/polls'; import Icon from 'soapbox/components/icon'; -import { Text } from 'soapbox/components/ui'; +import { Text, Button, Stack, HStack } from 'soapbox/components/ui'; import Motion from 'soapbox/features/ui/util/optional_motion'; import RelativeTimestamp from './relative_timestamp'; @@ -26,7 +26,7 @@ const PollPercentageBar: React.FC<{percent: number, leading: boolean}> = ({ perc {({ width }) =>( = ({ poll, option, index, active, percent, showResults, onToggle }) => { const intl = useIntl(); const voted = poll.own_votes?.includes(index); + const message = intl.formatMessage(messages.votes, { votes: option.votes_count }); - const handleOptionChange = (): void => { + const handleOptionChange: React.EventHandler = () => { onToggle(index); }; - const handleOptionKeyPress = (e: React.KeyboardEvent): void => { + const handleOptionKeyPress: React.EventHandler = e => { if (e.key === 'Enter' || e.key === ' ') { onToggle(index); e.stopPropagation(); @@ -57,8 +58,12 @@ const PollOptionText: React.FC = ({ poll, option, index, active }; return ( -