File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Sources/StreamChatSwiftUI/ChatChannel/MessageList Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55
66### ✅ Added
77- Add extra data to user display info [ #819 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/819 )
8+ - Make message spacing in message list configurable [ #830 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/830 )
89### 🐞 Fixed
910- Fix swipe to reply enabled when quoting a message is disabled [ #824 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/824 )
1011- Fix mark unread action not removed when read events are disabled [ #823 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/823 )
Original file line number Diff line number Diff line change @@ -33,7 +33,12 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
3333 @GestureState private var offset : CGSize = . zero
3434
3535 private let replyThreshold : CGFloat = 60
36- private let paddingValue : CGFloat = 8
36+ private var paddingValue : CGFloat {
37+ utils. messageListConfig. messagePaddings. singleBottom
38+ }
39+ private var groupMessageInterItemSpacing : CGFloat {
40+ utils. messageListConfig. messagePaddings. groupBottom
41+ }
3742
3843 var isSwipeToReplyPossible : Bool {
3944 message. isInteractionEnabled && channel. canQuoteMessage
@@ -275,7 +280,7 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
275280 topReactionsShown && !isMessagePinned ? messageListConfig. messageDisplayOptions. reactionsTopPadding ( message) : 0
276281 )
277282 . padding ( . horizontal, messageListConfig. messagePaddings. horizontal)
278- . padding ( . bottom, showsAllInfo || isMessagePinned ? paddingValue : 2 )
283+ . padding ( . bottom, showsAllInfo || isMessagePinned ? paddingValue : groupMessageInterItemSpacing )
279284 . padding ( . top, isLast ? paddingValue : 0 )
280285 . background ( isMessagePinned ? Color ( colors. pinnedBackground) : nil )
281286 . padding ( . bottom, isMessagePinned ? paddingValue / 2 : 0 )
Original file line number Diff line number Diff line change @@ -110,13 +110,19 @@ public struct MessagePaddings {
110110 /// Horizontal padding for messages.
111111 public let horizontal : CGFloat
112112 public let quotedViewPadding : CGFloat
113+ public let singleBottom : CGFloat
114+ public let groupBottom : CGFloat
113115
114116 public init (
115117 horizontal: CGFloat = 8 ,
116- quotedViewPadding: CGFloat = 8
118+ quotedViewPadding: CGFloat = 8 ,
119+ singleBottom: CGFloat = 8 ,
120+ groupBottom: CGFloat = 2
117121 ) {
118122 self . horizontal = horizontal
119123 self . quotedViewPadding = quotedViewPadding
124+ self . singleBottom = singleBottom
125+ self . groupBottom = groupBottom
120126 }
121127}
122128
You can’t perform that action at this time.
0 commit comments