diff --git a/client/src/components/Thread/ReplyCard.tsx b/client/src/components/Thread/ReplyCard.tsx index 37f8599..231cef3 100644 --- a/client/src/components/Thread/ReplyCard.tsx +++ b/client/src/components/Thread/ReplyCard.tsx @@ -5,7 +5,8 @@ import { Event } from 'nostr-tools'; import { nip19 } from 'nostr-tools'; import { getMetadata, uniqBy } from '../../utils/utils'; import ContentPreview from '../Modals/TextModal'; -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; +import { subPubkeysMetadata } from '../../utils/subscriptions'; const colorCombos = [ 'from-red-400 to-yellow-500', @@ -58,6 +59,7 @@ const timeAgo = (unixTime: number) => { const ReplyCard = ({ event, metadata, replyCount, repliedTo }: { event: Event, metadata: Event | null, replyCount: number, repliedTo: Event[] }) => { const { comment, file } = parseContent(event); const colorCombo = getColorFromHash(event.pubkey, colorCombos); + const [events, setEvents] = useState([]); let metadataParsed = null; if (metadata !== null) { @@ -66,13 +68,6 @@ const ReplyCard = ({ event, metadata, replyCount, repliedTo }: { event: Event, m const replyPubkeys = event.tags.filter(tag => tag[0] === 'p'); - // const getMetadataEvent = (event: Event) => { - // const metadataEvent = uniqEvents.find(e => e.pubkey === event.pubkey && e.kind === 0); - // if (metadataEvent) { - // return metadataEvent; - // } - // return null; - // } useEffect(() => { console.log(repliedTo) }, []); @@ -104,11 +99,14 @@ const ReplyCard = ({ event, metadata, replyCount, repliedTo }: { event: Event, m
Reply to: - {repliedTo.map((event, index) => ( - <> - {/* */} -
- + {uniqBy(repliedTo, 'pubkey').map((event, index) => ( +
+ {event.kind == 0 ? ( + + ) : ( +
+ )} +
))}