diff --git a/src/components/status.css b/src/components/status.css index 29839f47..e0d2e7c1 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -396,6 +396,13 @@ a.card:hover { gap: 8px; cursor: pointer; } +.poll-option-votes { + flex-shrink: 0; + font-size: 90%; +} +.poll-option-leading .poll-option-votes { + font-weight: bold; +} .poll-vote-button { margin-top: 8px; } diff --git a/src/components/status.jsx b/src/components/status.jsx index 213d1994..ef304de7 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -290,9 +290,13 @@ function Poll({ poll }) { const pollVotesCount = votersCount || votesCount; const percentage = Math.round((optionVotesCount / pollVotesCount) * 100) || 0; + // check if current poll choice is the leading one + const isLeading = + optionVotesCount > 0 && + optionVotesCount === Math.max(...options.map((o) => o.votesCount)); return (