diff --git a/src/components/ChatViewer.tsx b/src/components/ChatViewer.tsx index 9ad0914..5488b99 100644 --- a/src/components/ChatViewer.tsx +++ b/src/components/ChatViewer.tsx @@ -428,7 +428,12 @@ const MessageItem = memo(function MessageItem({ {/* Reactions display - inline after timestamp */} - + {shouldShowReplyPreview && zapReplyPointer && ( {/* Reactions display - inline after timestamp */} - + {canReply && onReply && !isRootMessage && ( - -
- {aggregated.map((reaction) => ( -
- {reaction.customEmoji ? ( - {`:${reaction.customEmoji.shortcode}:`} - ) : ( - {reaction.emoji} - )} - - {reaction.pubkeys.map((pk, i) => ( - - {i > 0 && - (i === reaction.pubkeys.length - 1 ? ( - and + +
+ {aggregated.map((reaction) => { + const hasReacted = activeAccount?.pubkey + ? reaction.pubkeys.includes(activeAccount.pubkey) + : false; + const emojiKey = reaction.customEmoji + ? `:${reaction.customEmoji.shortcode}:` + : reaction.emoji; + const isSending = sendingEmoji === emojiKey; + const isTappable = canSign && !hasReacted && !isSending; + + return ( +
+
+ {isTappable ? ( +
- ))} + {reaction.emoji} + )} + + ) : reaction.customEmoji ? ( + {`:${reaction.customEmoji.shortcode}:`} + ) : ( + + {reaction.emoji} + + )} + + {reaction.count} + +
+
+ {reaction.pubkeys.map((pk) => ( + + ))} +
+
+ ); + })}
); } -function ReactionBadge({ reaction }: { reaction: ReactionSummary }) { - const activeAccount = use$(accountManager.active$); - const hasUserReacted = activeAccount?.pubkey - ? reaction.pubkeys.includes(activeAccount.pubkey) - : false; - +function ReactionBadge({ + reaction, + hasUserReacted, +}: { + reaction: ReactionSummary; + hasUserReacted: boolean; +}) { return ( - + {reaction.customEmoji ? ( ) : ( - - {reaction.emoji} - + {reaction.emoji} )}