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/).
5
5
6
6
### ✅ Added
7
7
- 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 )
8
9
### 🐞 Fixed
9
10
- Fix swipe to reply enabled when quoting a message is disabled [ #824 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/824 )
10
11
- 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 {
33
33
@GestureState private var offset : CGSize = . zero
34
34
35
35
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
+ }
37
42
38
43
var isSwipeToReplyPossible : Bool {
39
44
message. isInteractionEnabled && channel. canQuoteMessage
@@ -275,7 +280,7 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
275
280
topReactionsShown && !isMessagePinned ? messageListConfig. messageDisplayOptions. reactionsTopPadding ( message) : 0
276
281
)
277
282
. padding ( . horizontal, messageListConfig. messagePaddings. horizontal)
278
- . padding ( . bottom, showsAllInfo || isMessagePinned ? paddingValue : 2 )
283
+ . padding ( . bottom, showsAllInfo || isMessagePinned ? paddingValue : groupMessageInterItemSpacing )
279
284
. padding ( . top, isLast ? paddingValue : 0 )
280
285
. background ( isMessagePinned ? Color ( colors. pinnedBackground) : nil )
281
286
. padding ( . bottom, isMessagePinned ? paddingValue / 2 : 0 )
Original file line number Diff line number Diff line change @@ -110,13 +110,19 @@ public struct MessagePaddings {
110
110
/// Horizontal padding for messages.
111
111
public let horizontal : CGFloat
112
112
public let quotedViewPadding : CGFloat
113
+ public let singleBottom : CGFloat
114
+ public let groupBottom : CGFloat
113
115
114
116
public init (
115
117
horizontal: CGFloat = 8 ,
116
- quotedViewPadding: CGFloat = 8
118
+ quotedViewPadding: CGFloat = 8 ,
119
+ singleBottom: CGFloat = 8 ,
120
+ groupBottom: CGFloat = 2
117
121
) {
118
122
self . horizontal = horizontal
119
123
self . quotedViewPadding = quotedViewPadding
124
+ self . singleBottom = singleBottom
125
+ self . groupBottom = groupBottom
120
126
}
121
127
}
122
128
You can’t perform that action at this time.
0 commit comments