show reply count in feed
This commit is contained in:
parent
d42d26fc20
commit
2099eddebc
@ -22,7 +22,7 @@ export default function NoteFooter(props: NoteFooterProps) {
|
||||
const [showReactions, setShowReactions] = useState(false);
|
||||
|
||||
const related = useReactions("reactions", ids, undefined, false);
|
||||
const { reactions, zaps, reposts } = useEventReactions(link, related);
|
||||
const { replies, reactions, zaps, reposts } = useEventReactions(link, related);
|
||||
const { positive } = reactions;
|
||||
|
||||
const { preferences: prefs, readonly } = useLogin(s => ({
|
||||
@ -33,7 +33,7 @@ export default function NoteFooter(props: NoteFooterProps) {
|
||||
|
||||
return (
|
||||
<div className="flex flex-row gap-4 overflow-hidden max-w-full h-6 items-center">
|
||||
<ReplyButton ev={ev} replyCount={props.replyCount} readonly={readonly} />
|
||||
<ReplyButton ev={ev} replyCount={props.replyCount ?? replies.length} readonly={readonly} />
|
||||
<RepostButton ev={ev} reposts={reposts} />
|
||||
{prefs.enableReactions && <LikeButton ev={ev} positiveReactions={positive} />}
|
||||
{CONFIG.showPowIcon && <PowIcon ev={ev} />}
|
||||
|
@ -47,6 +47,7 @@ export function useEventReactions(link: NostrLink, related: ReadonlyArray<Tagged
|
||||
positive: groupReactions[Reaction.Positive] ?? [],
|
||||
negative: groupReactions[Reaction.Negative] ?? [],
|
||||
},
|
||||
replies: reactionKinds[String(EventKind.TextNote)] ?? [],
|
||||
reposts,
|
||||
zaps,
|
||||
others: Object.fromEntries(
|
||||
|
@ -23,7 +23,7 @@ export function useReactions(
|
||||
);
|
||||
|
||||
for (const [, v] of Object.entries(grouped)) {
|
||||
rb.withFilter().kinds([EventKind.Reaction, EventKind.Repost, EventKind.ZapReceipt]).replyToLink(v);
|
||||
rb.withFilter().kinds([EventKind.TextNote, EventKind.Reaction, EventKind.Repost, EventKind.ZapReceipt]).replyToLink(v);
|
||||
}
|
||||
}
|
||||
others?.(rb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user