File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Sources/StreamChatSwiftUI/ChatChannel/MessageList Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,11 @@ struct MessageContainerView<Factory: ViewFactory>: View {
181
181
. padding ( . top, isLast ? paddingValue : 0 )
182
182
. background ( isMessagePinned ? Color ( colors. pinnedBackground) : nil )
183
183
. padding ( . bottom, isMessagePinned ? paddingValue / 2 : 0 )
184
+ . transition (
185
+ message. isSentByCurrentUser ?
186
+ messageListConfig. messageDisplayOptions. currentUserMessageTransition :
187
+ messageListConfig. messageDisplayOptions. otherUserMessageTransition
188
+ )
184
189
}
185
190
186
191
private var isMessagePinned : Bool {
Original file line number Diff line number Diff line change 4
4
5
5
import CoreGraphics
6
6
import StreamChat
7
+ import SwiftUI
7
8
8
9
/// Configuration for the message list.
9
10
public struct MessageListConfig {
@@ -67,15 +68,21 @@ public struct MessageDisplayOptions {
67
68
let showAvatars : Bool
68
69
let showMessageDate : Bool
69
70
let animateChanges : Bool
71
+ let currentUserMessageTransition : AnyTransition
72
+ let otherUserMessageTransition : AnyTransition
70
73
71
74
public init (
72
75
showAvatars: Bool = true ,
73
76
showMessageDate: Bool = true ,
74
- animateChanges: Bool = true
77
+ animateChanges: Bool = true ,
78
+ currentUserMessageTransition: AnyTransition = . identity,
79
+ otherUserMessageTransition: AnyTransition = . identity
75
80
) {
76
81
self . showAvatars = showAvatars
77
82
self . showMessageDate = showMessageDate
78
83
self . animateChanges = animateChanges
84
+ self . currentUserMessageTransition = currentUserMessageTransition
85
+ self . otherUserMessageTransition = otherUserMessageTransition
79
86
}
80
87
}
81
88
You can’t perform that action at this time.
0 commit comments