Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### ✅ Added
- Add `minOriginY` to the initializer of `ReactionsOverlayView` for better UI customization [#793](https://github.com/GetStream/stream-chat-swiftui/pull/793)
### 🔄 Changed

# [4.75.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.75.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
private var messageActionsCount: Int
private let paddingValue: CGFloat = 16
private let messageItemSize: CGFloat = 40
private let minOriginY: CGFloat
private var maxMessageActionsSize: CGFloat {
screenHeight / 3
}
Expand All @@ -39,6 +40,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
channel: ChatChannel,
currentSnapshot: UIImage,
messageDisplayInfo: MessageDisplayInfo,
minOriginY: CGFloat = 100,
bottomOffset: CGFloat = 0,
onBackgroundTap: @escaping () -> Void,
onActionExecuted: @escaping (MessageActionInfo) -> Void
Expand All @@ -51,6 +53,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
self.channel = channel
self.factory = factory
self.currentSnapshot = currentSnapshot
self.minOriginY = minOriginY
self.bottomOffset = bottomOffset
self.messageDisplayInfo = messageDisplayInfo
self.onBackgroundTap = onBackgroundTap
Expand Down Expand Up @@ -280,10 +283,9 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
let bottomPopupOffset =
messageDisplayInfo.showsMessageActions ? messageActionsSize : userReactionsPopupHeight
var originY = messageDisplayInfo.frame.origin.y
let minOrigin: CGFloat = 100
let maxOrigin: CGFloat = screenHeight - messageContainerHeight - bottomPopupOffset - minOrigin - bottomOffset
if originY < minOrigin {
originY = minOrigin
let maxOrigin: CGFloat = screenHeight - messageContainerHeight - bottomPopupOffset - minOriginY - bottomOffset
if originY < minOriginY {
originY = minOriginY
} else if originY > maxOrigin {
originY = maxOrigin
}
Expand Down
Loading