17 changed files with 85 additions and 88 deletions
@ -1,24 +0,0 @@
@@ -1,24 +0,0 @@
|
||||
import { useSecondaryPage } from '@renderer/PageManager' |
||||
import { Card } from '@renderer/components/ui/card' |
||||
import { toNote } from '@renderer/lib/link' |
||||
import { Event } from 'nostr-tools' |
||||
import UserAvatar from '../UserAvatar' |
||||
import Username from '../Username' |
||||
|
||||
export default function ParentNote({ event }: { event: Event }) { |
||||
const { push } = useSecondaryPage() |
||||
|
||||
return ( |
||||
<div> |
||||
<Card |
||||
className="flex space-x-1 p-1 items-center hover:bg-muted/50 cursor-pointer text-xs text-muted-foreground hover:text-foreground" |
||||
onClick={() => push(toNote(event))} |
||||
> |
||||
<UserAvatar userId={event.pubkey} size="tiny" /> |
||||
<Username userId={event.pubkey} className="font-semibold" /> |
||||
<div className="truncate">{event.content}</div> |
||||
</Card> |
||||
<div className="ml-5 w-px h-2 bg-border" /> |
||||
</div> |
||||
) |
||||
} |
||||
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
import { Event } from 'nostr-tools' |
||||
import UserAvatar from '../UserAvatar' |
||||
import { cn } from '@renderer/lib/utils' |
||||
|
||||
export default function ParentNotePreview({ |
||||
event, |
||||
className, |
||||
onClick |
||||
}: { |
||||
event: Event |
||||
className?: string |
||||
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined |
||||
}) { |
||||
return ( |
||||
<div |
||||
className={cn( |
||||
'flex space-x-1 items-center text-sm rounded-full px-2 bg-muted w-fit max-w-full text-muted-foreground hover:text-foreground cursor-pointer', |
||||
className |
||||
)} |
||||
onClick={onClick} |
||||
> |
||||
<div className="shrink-0">reply to</div> |
||||
<UserAvatar userId={event.pubkey} size="tiny" /> |
||||
<div className="truncate">{event.content}</div> |
||||
</div> |
||||
) |
||||
} |
||||
Loading…
Reference in new issue