Skip to content

Commit c80dff8

Browse files
authored
Merge pull request #594 from GetStream/CRNS-297-overlay-reactions-supported-fix
CRNS-297 - add supported reactions to MessageOverlay
2 parents c6022f8 + e24510e commit c80dff8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/components/MessageOverlay/MessageOverlay.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ const MessageOverlayWithContext = <
575575
}),
576576
)}
577577
showScreen={showScreen}
578+
supportedReactions={
579+
messagesContext?.supportedReactions
580+
}
578581
title={messageReactionTitle}
579582
/>
580583
) : null}

src/components/MessageOverlay/OverlayReactions.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ export const OverlayReactions: React.FC<OverlayReactionsProps> = (props) => {
156156

157157
const width = useWindowDimensions().width;
158158

159+
const supportedReactionTypes = supportedReactions.map(
160+
(supportedReaction) => supportedReaction.type,
161+
);
162+
163+
const filteredReactions = reactions.filter((reaction) =>
164+
supportedReactionTypes.includes(reaction.type),
165+
);
166+
159167
const numColumns = Math.floor(
160168
(width -
161169
overlayPadding * 2 -
@@ -330,7 +338,7 @@ export const OverlayReactions: React.FC<OverlayReactionsProps> = (props) => {
330338
>
331339
<Text style={[styles.title, { color: black }, titleStyle]}>{title}</Text>
332340
<FlatList
333-
data={reactions}
341+
data={filteredReactions}
334342
keyExtractor={({ name }, index) => `${name}_${index}`}
335343
numColumns={numColumns}
336344
renderItem={renderItem}

0 commit comments

Comments
 (0)