Skip to content

Commit

Permalink
Fix winner icon and votes text
Browse files Browse the repository at this point in the history
  • Loading branch information
timvahlbrock committed Oct 26, 2024
1 parent f6f0fe2 commit aa46664
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/views/polls/PollOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ type PollOptionContentProps = {
isWinner?: boolean;
};
const PollOptionContent: React.FC<PollOptionContentProps> = ({ isWinner, answer, votes, displayVoteCount }) => {
const votesText = displayVoteCount ? : "";
const votesText = displayVoteCount ? _t("timeline|m.poll|count_of_votes", { count: votes.length }) : "";
const room = useContext(RoomContext).room!;
const members = useRoomMembers(room);

return (
<div className="mx_PollOption_content">
<div className="mx_PollOption_optionText">{answer.text}</div>
<div className="mx_PollOption_optionVoteCount">
{isWinner && <TrophyIcon className="mx_PollOption_winnerIcon" />}
<div style={{ display: "flex" }}>
{displayVoteCount
&& members.length <= MAXIMUM_MEMBERS_FOR_FACE_PILE
Expand All @@ -46,7 +45,10 @@ const PollOptionContent: React.FC<PollOptionContentProps> = ({ isWinner, answer,
style={{ marginRight: "10px" }}
/>
}
{votesText}
<span>
{isWinner && <TrophyIcon className="mx_PollOption_winnerIcon" />}
{votesText}
</span>
</div>
</div>
</div>
Expand Down

0 comments on commit aa46664

Please sign in to comment.