Fixes #2609 - Add trophy icon next to the winning poll option (#2610)

* Fixes #2609 - Add trophy icon next to the winning poll option

* Address PR comments
This commit is contained in:
Stefan Ceriu
2024-03-27 10:50:32 +02:00
committed by GitHub
parent 189d081da0
commit d72fa02ac6
9 changed files with 51 additions and 11 deletions
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct PollOptionView: View {
@@ -39,9 +40,20 @@ struct PollOptionView: View {
.frame(maxWidth: .infinity, alignment: .leading)
if showVotes {
Text(L10n.commonPollVotesCount(pollOption.votes))
.font(isFinalWinningOption ? .compound.bodySMSemibold : .compound.bodySM)
.foregroundColor(isFinalWinningOption ? .compound.textPrimary : .compound.textSecondary)
if isFinalWinningOption {
HStack(spacing: 4) {
CompoundIcon(asset: Asset.Images.pollWinner)
.foregroundColor(.compound.iconAccentTertiary)
Text(L10n.commonPollVotesCount(pollOption.votes))
.font(.compound.bodySMSemibold)
.foregroundColor(.compound.textPrimary)
}
} else {
Text(L10n.commonPollVotesCount(pollOption.votes))
.font(.compound.bodySM)
.foregroundColor(.compound.textSecondary)
}
}
}