Skip to content
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 @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### 🐞 Fixed
- Fix message long press taking too much time to show actions [#648](https://github.com/GetStream/stream-chat-swiftui/pull/648)
- Fix rendering link attachment preview with other attachment types [#659](https://github.com/GetStream/stream-chat-swiftui/pull/659)
- Fix not using colors from the palette in some of the poll views [#661](https://github.com/GetStream/stream-chat-swiftui/pull/661)
### 🔄 Changed
- Message composer now uses `.uploadFile` capability when showing attachment picker icon [#646](https://github.com/GetStream/stream-chat-swiftui/pull/646)
- `ChannelInfoView` now uses `.updateChannelMembers` capability to show "Add Users" button [#651](https://github.com/GetStream/stream-chat-swiftui/pull/651)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct PollAllOptionsView: View {
viewModel: viewModel,
option: option,
optionFont: fonts.headline,
textColor: Color(colors.text),
alternativeStyle: true,
checkboxButtonSpacing: 8
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public struct PollAttachmentView<Factory: ViewFactory>: View {
HStack {
Text(poll.name)
.font(fonts.bodyBold)
.foregroundColor(textColor(for: message))
Spacer()
}

Expand All @@ -56,7 +57,8 @@ public struct PollAttachmentView<Factory: ViewFactory>: View {
viewModel: viewModel,
option: option,
optionVotes: poll.voteCount(for: option),
maxVotes: poll.currentMaximumVoteCount
maxVotes: poll.currentMaximumVoteCount,
textColor: textColor(for: message)
)
.layoutPriority(1) // do not compress long text
}
Expand Down Expand Up @@ -188,6 +190,7 @@ struct PollOptionView: View {
var optionFont: Font = InjectedValues[\.fonts].body
var optionVotes: Int?
var maxVotes: Int?
var textColor: Color
/// If true, only option name and vote count is shown, otherwise votes indicator and avatars appear as well.
var alternativeStyle: Bool = false
/// The spacing between the checkbox and the option name.
Expand All @@ -211,6 +214,7 @@ struct PollOptionView: View {
HStack(alignment: .top) {
Text(option.text)
.font(optionFont)
.foregroundColor(textColor)
Spacer()
if !alternativeStyle, viewModel.showVoterAvatars {
HStack(spacing: -4) {
Expand All @@ -225,6 +229,7 @@ struct PollOptionView: View {
}
}
Text("\(viewModel.poll.voteCountsByOption?[option.id] ?? 0)")
.foregroundColor(textColor)
}
if !alternativeStyle {
PollVotesIndicatorView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct PollResultsView: View {
Spacer()
}
}
.background(Color(colors.background8).ignoresSafeArea())
.toolbar {
ToolbarItem(placement: .principal) {
Text(L10n.Message.Polls.Toolbar.resultsTitle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ struct CreatePollView: View {
Spacer()
.modifier(ListRowModifier())
}
.background(Color(colors.background8).ignoresSafeArea())
.listStyle(.plain)
.id(listId)
.toolbar {
Expand Down Expand Up @@ -229,11 +230,14 @@ struct CreatePollItemModifier: ViewModifier {
}

struct ListRowModifier: ViewModifier {


@Injected(\.colors) var colors

func body(content: Content) -> some View {
if #available(iOS 15.0, *) {
content
.listRowSeparator(.hidden)
.listRowBackground(Color(colors.background8))
} else {
content
}
Expand Down
Loading