feat: improve parent note preview
This commit is contained in:
parent
e6516d7acd
commit
212a4ac103
11 changed files with 167 additions and 60 deletions
|
|
@ -1,6 +1,4 @@
|
|||
import { Separator } from '@/components/ui/separator'
|
||||
import { useFetchEvent } from '@/hooks'
|
||||
import { getParentEventId, getRootEventId } from '@/lib/event'
|
||||
import { toNote } from '@/lib/link'
|
||||
import { useSecondaryPage } from '@/PageManager'
|
||||
import { Event } from 'nostr-tools'
|
||||
|
|
@ -19,8 +17,6 @@ export default function MainNoteCard({
|
|||
embedded?: boolean
|
||||
}) {
|
||||
const { push } = useSecondaryPage()
|
||||
const { event: rootEvent } = useFetchEvent(getRootEventId(event))
|
||||
const { event: parentEvent } = useFetchEvent(getParentEventId(event))
|
||||
return (
|
||||
<div
|
||||
className={className}
|
||||
|
|
@ -33,12 +29,7 @@ export default function MainNoteCard({
|
|||
className={`clickable text-left ${embedded ? 'p-2 sm:p-3 border rounded-lg' : 'px-4 py-3'}`}
|
||||
>
|
||||
<RepostDescription reposter={reposter} />
|
||||
<Note
|
||||
size={embedded ? 'small' : 'normal'}
|
||||
event={event}
|
||||
parentEvent={parentEvent ?? rootEvent}
|
||||
hideStats={embedded}
|
||||
/>
|
||||
<Note size={embedded ? 'small' : 'normal'} event={event} hideStats={embedded} />
|
||||
</div>
|
||||
{!embedded && <Separator />}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue