Skip to content

Commit 2b6adc7

Browse files
Improved display of reactions overlay on large messages
1 parent 15c8379 commit 2b6adc7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/StreamChatSwiftUI/ChatChannel/Reactions/ReactionsOverlayView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
111111
)
112112
.frame(
113113
width: messageDisplayInfo.frame.width,
114-
height: messageDisplayInfo.frame.height
114+
height: messageContainerHeight
115115
)
116116

117117
if messageDisplayInfo.showsMessageActions {
@@ -158,6 +158,13 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
158158
}
159159
}
160160

161+
private var messageContainerHeight: CGFloat {
162+
let screenHeight = UIScreen.main.bounds.size.height
163+
let maxAllowed = screenHeight / 2
164+
let containerHeight = messageDisplayInfo.frame.height
165+
return containerHeight > maxAllowed ? maxAllowed : containerHeight
166+
}
167+
161168
private var popInAnimation: Animation {
162169
.spring(response: 0.2, dampingFraction: 0.7, blendDuration: 0.2)
163170
}

0 commit comments

Comments
 (0)