diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f92e0b32..c3de85f7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAllOptionsView.swift b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAllOptionsView.swift index e8a2de2fb..e52fa6a89 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAllOptionsView.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAllOptionsView.swift @@ -31,6 +31,7 @@ struct PollAllOptionsView: View { viewModel: viewModel, option: option, optionFont: fonts.headline, + textColor: Color(colors.text), alternativeStyle: true, checkboxButtonSpacing: 8 ) diff --git a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAttachmentView.swift b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAttachmentView.swift index ad17f8401..f56d82d91 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAttachmentView.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAttachmentView.swift @@ -40,6 +40,7 @@ public struct PollAttachmentView: View { HStack { Text(poll.name) .font(fonts.bodyBold) + .foregroundColor(textColor(for: message)) Spacer() } @@ -56,7 +57,8 @@ public struct PollAttachmentView: 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 } @@ -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. @@ -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) { @@ -225,6 +229,7 @@ struct PollOptionView: View { } } Text("\(viewModel.poll.voteCountsByOption?[option.id] ?? 0)") + .foregroundColor(textColor) } if !alternativeStyle { PollVotesIndicatorView( diff --git a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollResultsView.swift b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollResultsView.swift index 46b1b3e29..0ca9e5803 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollResultsView.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollResultsView.swift @@ -55,6 +55,7 @@ struct PollResultsView: View { Spacer() } } + .background(Color(colors.background8).ignoresSafeArea()) .toolbar { ToolbarItem(placement: .principal) { Text(L10n.Message.Polls.Toolbar.resultsTitle) diff --git a/Sources/StreamChatSwiftUI/ChatChannel/Polls/CreatePollView.swift b/Sources/StreamChatSwiftUI/ChatChannel/Polls/CreatePollView.swift index d9cf63671..180219be1 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/Polls/CreatePollView.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/Polls/CreatePollView.swift @@ -162,6 +162,7 @@ struct CreatePollView: View { Spacer() .modifier(ListRowModifier()) } + .background(Color(colors.background8).ignoresSafeArea()) .listStyle(.plain) .id(listId) .toolbar { @@ -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 }