Skip to content

Commit af56120

Browse files
Configuration for highlighted composer border color
1 parent 803db4d commit af56120

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

44
# Upcoming
55

6+
### ✅ Added
7+
- Configuration for highlighted composer border color
8+
69
### 🐞 Fixed
710
- Improved loading of gallery images
811

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerView.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
217217
}
218218

219219
/// View for the composer's input (text and media).
220-
public struct ComposerInputView<Factory: ViewFactory>: View {
220+
public struct ComposerInputView<Factory: ViewFactory>: View, KeyboardReadable {
221221

222222
@EnvironmentObject var viewModel: MessageComposerViewModel
223223

@@ -240,6 +240,7 @@ public struct ComposerInputView<Factory: ViewFactory>: View {
240240
var removeAttachmentWithId: (String) -> Void
241241

242242
@State var textHeight: CGFloat = TextSizeConstants.minimumHeight
243+
@State var keyboardShown = false
243244

244245
public init(
245246
factory: Factory,
@@ -387,11 +388,14 @@ public struct ComposerInputView<Factory: ViewFactory>: View {
387388
.background(composerInputBackground)
388389
.overlay(
389390
RoundedRectangle(cornerRadius: TextSizeConstants.cornerRadius)
390-
.stroke(Color(colors.innerBorder))
391+
.stroke(Color(keyboardShown ? colors.composerInputHighlightedBorder : colors.innerBorder))
391392
)
392393
.clipShape(
393394
RoundedRectangle(cornerRadius: TextSizeConstants.cornerRadius)
394395
)
396+
.onReceive(keyboardWillChangePublisher) { visible in
397+
keyboardShown = visible
398+
}
395399
.accessibilityIdentifier("ComposerInputView")
396400
}
397401

Sources/StreamChatSwiftUI/ColorPalette.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public struct ColorPalette {
8484

8585
public lazy var composerPlaceholderColor: UIColor = subtitleText
8686
public lazy var composerInputBackground: UIColor = background
87+
public var composerInputHighlightedBorder: UIColor = .streamInnerBorder
8788
}
8889

8990
// Those colors are default defined stream constants, which are fallback values if you don't implement your color theme.

0 commit comments

Comments
 (0)