Skip to content

Commit 9300e70

Browse files
authored
Support custom colors in ChannelTitleView (#931)
1 parent a7f2f41 commit 9300e70

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
### 🐞 Fixed
77
- Show attachment title instead of URL in the `FileAttachmentPreview` view [#930](https://github.com/GetStream/stream-chat-swiftui/pull/930)
8+
- Fix overriding title color in `ChannelTitleView` [#931](https://github.com/GetStream/stream-chat-swiftui/pull/931)
89

910
# [4.86.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.86.0)
1011
_August 21, 2025_

Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public struct ChannelTitleView: View {
145145
VStack(spacing: 2) {
146146
Text(channelNamer(channel, currentUserId) ?? "")
147147
.font(fonts.bodyBold)
148+
.foregroundColor(Color(colors.text))
148149
.accessibilityIdentifier("chatName")
149150

150151
if shouldShowTypingIndicator {

StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,21 @@ class ChatChannelHeader_Tests: StreamChatTestCase {
7676
// Then
7777
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
7878
}
79+
80+
func test_channelTitleView_theme_snapshot() {
81+
// Given
82+
let channel = ChatChannel.mockDMChannel(name: "Test channel")
83+
84+
// When
85+
adjustAppearance { appearance in
86+
appearance.colors.text = .red
87+
appearance.colors.subtitleText = .blue
88+
}
89+
let size = CGSize(width: 300, height: 100)
90+
let view = ChannelTitleView(channel: channel, shouldShowTypingIndicator: true)
91+
.applySize(size)
92+
93+
// Then
94+
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
95+
}
7996
}
15.1 KB
Loading

0 commit comments

Comments
 (0)