Skip to content

Commit 23bdfd9

Browse files
Added configuration for padding for quoted message views (#598)
1 parent 80a37f8 commit 23bdfd9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-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 padding for quoted message views [#598](https://github.com/GetStream/stream-chat-swiftui/pull/598)
8+
69
### 🔄 Changed
710
- Improved subtitle info in pinned messages view [#594](https://github.com/GetStream/stream-chat-swiftui/pull/594)
811
- The `image(for channel: ChatChannel)` in `ChannelHeaderLoader` is now open [#595](https://github.com/GetStream/stream-chat-swiftui/pull/595)

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListConfig.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,14 @@ public struct MessagePaddings {
8888

8989
/// Horizontal padding for messages.
9090
public let horizontal: CGFloat
91+
public let quotedViewPadding: CGFloat
9192

92-
public init(horizontal: CGFloat = 8) {
93+
public init(
94+
horizontal: CGFloat = 8,
95+
quotedViewPadding: CGFloat = 8
96+
) {
9397
self.horizontal = horizontal
98+
self.quotedViewPadding = quotedViewPadding
9499
}
95100
}
96101

Sources/StreamChatSwiftUI/ChatChannel/MessageList/QuotedMessageView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ public struct QuotedMessageView<Factory: ViewFactory>: View {
144144
}
145145
}
146146
.id(quotedMessage.messageId)
147-
.padding(hasVoiceAttachments ? [.leading, .top, .bottom] : .all, 8)
147+
.padding(
148+
hasVoiceAttachments ? [.leading, .top, .bottom] : .all, utils.messageListConfig.messagePaddings.quotedViewPadding
149+
)
148150
.modifier(
149151
factory.makeMessageViewModifier(
150152
for: MessageModifierInfo(

0 commit comments

Comments
 (0)