Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the display of the cup icon in Polls #538

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### 🐞 Fixed
- Smoother and more performant view updates in channel and message lists [#522](https://github.com/GetStream/stream-chat-swiftui/pull/522)
- Fix scrolling location when jumping to a message not in the currently loaded message list [#533](https://github.com/GetStream/stream-chat-swiftui/pull/533)
- Fix display of the most votes icon in Polls [#538](https://github.com/GetStream/stream-chat-swiftui/pull/538)

# [4.58.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.58.0)
_June 27, 2024_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct PollResultsView: View {
option.latestVotes.sorted(by: { $0.createdAt > $1.createdAt })
.prefix(numberOfItemsShown)
),
hasMostVotes: viewModel.hasMostVotes(for: option),
allButtonShown: option.latestVotes.count > numberOfItemsShown
)
}
Expand Down Expand Up @@ -80,6 +81,7 @@ struct PollOptionResultsView: View {
var poll: Poll
var option: PollOption
var votes: [PollVote]
var hasMostVotes: Bool = false
var allButtonShown = false
var onVoteAppear: ((PollVote) -> Void)?

Expand All @@ -89,10 +91,12 @@ struct PollOptionResultsView: View {
Text(option.text)
.font(fonts.bodyBold)
Spacer()
Image(systemName: "trophy")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 16)
if hasMostVotes {
Image(systemName: "trophy")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 16)
}
Text(L10n.Message.Polls.votes(poll.voteCountsByOption?[option.id] ?? 0))
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading