Move poll option styling to css file

This commit is contained in:
Tim Vahlbrock 2024-11-01 12:47:14 +01:00
parent 22729f4513
commit 3730cb4653
No known key found for this signature in database
2 changed files with 19 additions and 12 deletions

View file

@ -35,6 +35,14 @@ Please see LICENSE files in the repository root for full details.
justify-content: space-between; justify-content: space-between;
} }
.mx_PollOption_votesWrapper {
display: flex;
}
.mx_PollOption_facePile {
margin-right: $spacing-8
}
.mx_PollOption_optionVoteCount { .mx_PollOption_optionVoteCount {
color: $secondary-content; color: $secondary-content;
font-size: $font-12px; font-size: $font-12px;

View file

@ -33,22 +33,21 @@ const PollOptionContent: React.FC<PollOptionContentProps> = ({ isWinner, answer,
return ( return (
<div className="mx_PollOption_content"> <div className="mx_PollOption_content">
<div className="mx_PollOption_optionText">{answer.text}</div> <div className="mx_PollOption_optionText">{answer.text}</div>
<div> <div className="mx_PollOption_votesWrapper">
<div style={{ display: "flex" }}> {displayVoteCount
{displayVoteCount && members.length <= MAXIMUM_MEMBERS_FOR_FACE_PILE
&& members.length <= MAXIMUM_MEMBERS_FOR_FACE_PILE && <div className="mx_PollOption_facePile">
&& <FacePile <FacePile
members={members.filter((m) => votes.some((v) => v.sender === m.userId))} members={members.filter((m) => votes.some((v) => v.sender === m.userId))}
size="24px" size="24px"
overflow={false} overflow={false}
style={{ marginRight: "10px" }}
/> />
} </div>
<span className="mx_PollOption_optionVoteCount"> }
{isWinner && <TrophyIcon className="mx_PollOption_winnerIcon" />} <span className="mx_PollOption_optionVoteCount">
{votesText} {isWinner && <TrophyIcon className="mx_PollOption_winnerIcon" />}
</span> {votesText}
</div> </span>
</div> </div>
</div> </div>
); );