diff --git a/src/components/Timeline/Shared/Poll.tsx b/src/components/Timeline/Shared/Poll.tsx index b4c6a91f..bab34fa4 100644 --- a/src/components/Timeline/Shared/Poll.tsx +++ b/src/components/Timeline/Shared/Poll.tsx @@ -145,36 +145,6 @@ const TimelinePoll: React.FC = ({ mutation.isLoading ]) - const pollExpiration = useMemo(() => { - if (poll.expired) { - return ( - - {t('shared.poll.meta.expiration.expired')} - - ) - } else { - if (poll.expires_at) { - return ( - - - ]} - /> - - ) - } - } - }, [theme, i18n.language, poll.expired, poll.expires_at]) - const isSelected = useCallback( (index: number): string => allOptions[index] @@ -302,21 +272,38 @@ const TimelinePoll: React.FC = ({ const pollVoteCounts = useMemo(() => { if (poll.voters_count !== null) { return ( - - {t('shared.poll.meta.count.voters', { count: poll.voters_count })} - {' • '} - + t('shared.poll.meta.count.voters', { count: poll.voters_count }) + ' • ' ) } else if (poll.votes_count !== null) { return ( - - {t('shared.poll.meta.count.votes', { count: poll.votes_count })} - {' • '} - + t('shared.poll.meta.count.votes', { count: poll.votes_count }) + ' • ' ) } }, [poll.voters_count, poll.votes_count]) + const pollExpiration = useMemo(() => { + if (poll.expired) { + return t('shared.poll.meta.expiration.expired') + } else { + if (poll.expires_at) { + return ( + + ]} + /> + ) + } + } + }, [theme, i18n.language, poll.expired, poll.expires_at]) + return ( {poll.expired || poll.voted ? pollBodyDisallow : pollBodyAllow} @@ -329,8 +316,13 @@ const TimelinePoll: React.FC = ({ }} > {pollButton} - {pollVoteCounts} - {pollExpiration} + + {pollVoteCounts} + {pollExpiration} + )