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
3 changes: 3 additions & 0 deletions package/src/components/Channel/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ export type ChannelPropsWithContext = Pick<ChannelContextValue, 'channel'> &
| 'MessageUserReactionsItem'
| 'ReactionListBottom'
| 'reactionListPosition'
| 'reactionListType'
| 'ReactionListTop'
| 'Reply'
| 'shouldShowUnreadUnderlay'
Expand Down Expand Up @@ -708,6 +709,7 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
PollContent,
ReactionListBottom = ReactionListBottomDefault,
reactionListPosition = 'top',
reactionListType = 'segmented',
ReactionListTop = ReactionListTopDefault,
Reply = ReplyDefault,
ScrollToBottomButton = ScrollToBottomButtonDefault,
Expand Down Expand Up @@ -1960,6 +1962,7 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
PollContent,
ReactionListBottom,
reactionListPosition,
reactionListType,
ReactionListTop,
removeMessage,
Reply,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const useCreateMessagesContext = ({
PollContent,
ReactionListBottom,
reactionListPosition,
reactionListType,
ReactionListTop,
removeMessage,
Reply,
Expand Down Expand Up @@ -198,6 +199,7 @@ export const useCreateMessagesContext = ({
PollContent,
ReactionListBottom,
reactionListPosition,
reactionListType,
ReactionListTop,
removeMessage,
Reply,
Expand Down
12 changes: 6 additions & 6 deletions package/src/components/Message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ export type MessagePropsWithContext = Pick<
*/
const MessageWithContext = (props: MessagePropsWithContext) => {
const [isErrorInMessage, setIsErrorInMessage] = useState(false);
const [showMessageReactions, setShowMessageReactions] = useState(false);
const [showMessageReactions, setShowMessageReactions] = useState<boolean>(false);
const [selectedReaction, setSelectedReaction] = useState<string | undefined>(undefined);
const [isBounceDialogOpen, setIsBounceDialogOpen] = useState(false);
// const [selectedReaction, setSelectedReaction] = useState<string | undefined>(undefined);

const {
channel,
Expand Down Expand Up @@ -349,10 +349,9 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
}
});

const showReactionsOverlay = useStableCallback(() => {
if (!showMessageReactions) {
setShowMessageReactions(true);
}
const showReactionsOverlay = useStableCallback((reactionType?: string) => {
setShowMessageReactions(true);
setSelectedReaction(reactionType);
});

const { setNativeScrollability } = useMessageListItemContext();
Expand Down Expand Up @@ -880,6 +879,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
message={message}
MessageUserReactionsAvatar={MessageUserReactionsAvatar}
MessageUserReactionsItem={MessageUserReactionsItem}
selectedReaction={selectedReaction}
/>
</BottomSheetModal>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export type MessageSimplePropsWithContext = Pick<
| 'messageSwipeToReplyHitSlop'
| 'ReactionListBottom'
| 'reactionListPosition'
| 'reactionListType'
| 'ReactionListTop'
> & {
/**
Expand Down Expand Up @@ -113,6 +114,7 @@ const MessageSimpleWithContext = forwardRef<View, MessageSimplePropsWithContext>
otherAttachments,
ReactionListBottom,
reactionListPosition,
reactionListType,
ReactionListTop,
shouldRenderSwipeableWrapper,
setQuotedMessage,
Expand Down Expand Up @@ -274,7 +276,7 @@ const MessageSimpleWithContext = forwardRef<View, MessageSimplePropsWithContext>
</View>

{reactionListPosition === 'bottom' && ReactionListBottom ? (
<ReactionListBottom />
<ReactionListBottom type={reactionListType} />
) : null}
<MessageFooter date={message.created_at} isDeleted={!!isMessageTypeDeleted} />
</View>
Expand Down Expand Up @@ -452,6 +454,7 @@ export const MessageSimple = forwardRef<View, MessageSimpleProps>((props, ref) =
myMessageTheme,
ReactionListBottom,
reactionListPosition,
reactionListType,
ReactionListTop,
} = useMessagesContext();
const isAIGenerated = useMemo(
Expand Down Expand Up @@ -486,6 +489,7 @@ export const MessageSimple = forwardRef<View, MessageSimpleProps>((props, ref) =
otherAttachments,
ReactionListBottom,
reactionListPosition,
reactionListType,
ReactionListTop,
setQuotedMessage,
shouldRenderSwipeableWrapper,
Expand Down
Loading