Skip to content

Commit 8306ede

Browse files
fix: Reaction picker shown for users who can't react (#2061)
1 parent 71451f6 commit 8306ede

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

packages/react/src/components/Comments/Comment.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -274,21 +274,23 @@ export const Comment = ({
274274
onReactionSelect={onReactionSelect}
275275
/>
276276
))}
277-
<EmojiPicker
278-
onEmojiSelect={(emoji: { native: string }) =>
279-
onReactionSelect(emoji.native)
280-
}
281-
>
282-
<Components.Generic.Badge.Root
283-
className={mergeCSSClasses(
284-
"bn-badge",
285-
"bn-comment-add-reaction",
286-
)}
287-
text={"+"}
288-
icon={<RiEmotionLine size={16} />}
289-
mainTooltip={dict.comments.actions.add_reaction}
290-
/>
291-
</EmojiPicker>
277+
{canAddReaction && (
278+
<EmojiPicker
279+
onEmojiSelect={(emoji: { native: string }) =>
280+
onReactionSelect(emoji.native)
281+
}
282+
>
283+
<Components.Generic.Badge.Root
284+
className={mergeCSSClasses(
285+
"bn-badge",
286+
"bn-comment-add-reaction",
287+
)}
288+
text={"+"}
289+
icon={<RiEmotionLine size={16} />}
290+
mainTooltip={dict.comments.actions.add_reaction}
291+
/>
292+
</EmojiPicker>
293+
)}
292294
</Components.Generic.Badge.Group>
293295
)}
294296
{isEditing && (

0 commit comments

Comments
 (0)