Skip to content

Commit 3289fb3

Browse files
authored
Use bright color for typing indicator in dark mode (#702)
1 parent b42e80c commit 3289fb3

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

44
# Upcoming
55

6-
### 🔄 Changed
6+
### 🐞 Fixed
7+
- Use bright color for typing indicator animation in dark mode [#702](https://github.com/GetStream/stream-chat-swiftui/pull/702)
78

89
# [4.69.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.69.0)
910
_December 18, 2024_

Sources/StreamChatSwiftUI/CommonViews/TypingIndicatorView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public struct TypingIndicatorView: View {
1212
private let animationDuration: CGFloat = 0.75
1313

1414
public init() { /* Public init */ }
15+
16+
init(isTyping: Bool) {
17+
_isTyping = State<Bool>(wrappedValue: isTyping)
18+
}
1519

1620
public var body: some View {
1721
HStack(spacing: 4) {
@@ -42,7 +46,8 @@ public struct TypingIndicatorView: View {
4246

4347
/// View that represents one circle of the typing indicator view.
4448
private struct TypingIndicatorCircle: View {
45-
49+
@Injected(\.colors) var colors
50+
4651
private let circleWidth: CGFloat = 4
4752
private let circleHeight: CGFloat = 4
4853
private let yOffset: CGFloat = 1.5
@@ -53,6 +58,7 @@ private struct TypingIndicatorCircle: View {
5358

5459
var body: some View {
5560
Circle()
61+
.foregroundColor(Color(colors.text))
5662
.frame(width: circleWidth, height: circleHeight)
5763
.opacity(isTyping ? maxOpacity : minOpacity)
5864
.offset(y: isTyping ? yOffset : -yOffset)

StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ class TypingIndicatorView_Tests: StreamChatTestCase {
1111

1212
func test_typingIndicatorView_snapshot() {
1313
// Given
14-
let view = TypingIndicatorView()
14+
let view = TypingIndicatorView(isTyping: true)
1515
.frame(width: 20, height: 16)
1616

1717
// Then
18-
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
18+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles, size: CGSize(width: 20, height: 16))
1919
}
2020
}
Loading
Loading

0 commit comments

Comments
 (0)