Skip to content

Commit 92b63b5

Browse files
Option to specify bottom offset in ReactionsOverlayView
1 parent 66ee1e3 commit 92b63b5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
### 🐞 Fixed
1111
- `AttachmentTextView` respects configured body font
1212

13+
### ✅ Added
14+
- Option to specify bottom offset in `ReactionsOverlayView`
15+
1316
# [4.34.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.34.0)
1417
_July 06, 2023_
1518

Sources/StreamChatSwiftUI/ChatChannel/Reactions/ReactionsOverlayView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
1818
var factory: Factory
1919
var channel: ChatChannel
2020
var currentSnapshot: UIImage
21+
var bottomOffset: CGFloat
2122
var messageDisplayInfo: MessageDisplayInfo
2223
var onBackgroundTap: () -> Void
2324
var onActionExecuted: (MessageActionInfo) -> Void
@@ -34,6 +35,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
3435
channel: ChatChannel,
3536
currentSnapshot: UIImage,
3637
messageDisplayInfo: MessageDisplayInfo,
38+
bottomOffset: CGFloat = 0,
3739
onBackgroundTap: @escaping () -> Void,
3840
onActionExecuted: @escaping (MessageActionInfo) -> Void
3941
) {
@@ -45,6 +47,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
4547
self.channel = channel
4648
self.factory = factory
4749
self.currentSnapshot = currentSnapshot
50+
self.bottomOffset = bottomOffset
4851
self.messageDisplayInfo = messageDisplayInfo
4952
self.onBackgroundTap = onBackgroundTap
5053
self.onActionExecuted = onActionExecuted
@@ -242,7 +245,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
242245
messageDisplayInfo.showsMessageActions ? messageActionsSize : userReactionsPopupHeight
243246
var originY = messageDisplayInfo.frame.origin.y
244247
let minOrigin: CGFloat = 100
245-
let maxOrigin: CGFloat = screenHeight - messageContainerHeight - bottomPopupOffset - minOrigin
248+
let maxOrigin: CGFloat = screenHeight - messageContainerHeight - bottomPopupOffset - minOrigin - bottomOffset
246249
if originY < minOrigin {
247250
originY = minOrigin
248251
} else if originY > maxOrigin {

0 commit comments

Comments
 (0)