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

Use bright color for typing indicator in dark mode #702

Merged
merged 1 commit into from
Jan 2, 2025
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

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

# [4.69.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.69.0)
_December 18, 2024_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public struct TypingIndicatorView: View {
private let animationDuration: CGFloat = 0.75

public init() { /* Public init */ }

init(isTyping: Bool) {
_isTyping = State<Bool>(wrappedValue: isTyping)
}

public var body: some View {
HStack(spacing: 4) {
Expand Down Expand Up @@ -42,7 +46,8 @@ public struct TypingIndicatorView: View {

/// View that represents one circle of the typing indicator view.
private struct TypingIndicatorCircle: View {

@Injected(\.colors) var colors

private let circleWidth: CGFloat = 4
private let circleHeight: CGFloat = 4
private let yOffset: CGFloat = 1.5
Expand All @@ -53,6 +58,7 @@ private struct TypingIndicatorCircle: View {

var body: some View {
Circle()
.foregroundColor(Color(colors.text))
.frame(width: circleWidth, height: circleHeight)
.opacity(isTyping ? maxOpacity : minOpacity)
.offset(y: isTyping ? yOffset : -yOffset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class TypingIndicatorView_Tests: StreamChatTestCase {

func test_typingIndicatorView_snapshot() {
// Given
let view = TypingIndicatorView()
let view = TypingIndicatorView(isTyping: true)
.frame(width: 20, height: 16)

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
AssertSnapshot(view, variants: .onlyUserInterfaceStyles, size: CGSize(width: 20, height: 16))
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading