Skip to content

Commit 09b741c

Browse files
Added channel config for reactions
1 parent 8a66431 commit 09b741c

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ struct MessageContainerView<Factory: ViewFactory>: View {
177177
}
178178

179179
private var reactionsShown: Bool {
180-
!message.reactionScores.isEmpty && !message.isDeleted
180+
!message.reactionScores.isEmpty
181+
&& !message.isDeleted
182+
&& channel.config.reactionsEnabled
181183
}
182184

183185
private func dragChanged(to value: CGFloat) {

Sources/StreamChatSwiftUI/ChatChannel/Reactions/ReactionsOverlayView.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,20 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
7474
x: messageDisplayInfo.frame.origin.x
7575
)
7676
.overlay(
77-
ReactionsOverlayContainer(
78-
message: viewModel.message,
79-
contentRect: messageDisplayInfo.frame,
80-
onReactionTap: { reaction in
81-
viewModel.reactionTapped(reaction)
82-
onBackgroundTap()
83-
}
84-
)
85-
.offset(
86-
x: messageDisplayInfo.frame.origin.x,
87-
y: -24
88-
)
77+
channel.config.reactionsEnabled ?
78+
ReactionsOverlayContainer(
79+
message: viewModel.message,
80+
contentRect: messageDisplayInfo.frame,
81+
onReactionTap: { reaction in
82+
viewModel.reactionTapped(reaction)
83+
onBackgroundTap()
84+
}
85+
)
86+
.offset(
87+
x: messageDisplayInfo.frame.origin.x,
88+
y: -24
89+
)
90+
: nil
8991
)
9092
.frame(
9193
width: messageDisplayInfo.frame.width,

0 commit comments

Comments
 (0)