feat: preview note

This commit is contained in:
2023-03-31 23:43:07 +01:00
parent 0b00310212
commit b4f37b1ed3
4 changed files with 65 additions and 22 deletions

View File

@ -46,6 +46,7 @@ export interface NoteProps {
showReactionsLink?: boolean;
canUnpin?: boolean;
canUnbookmark?: boolean;
canClick?: boolean;
};
}
@ -177,7 +178,7 @@ export default function Note(props: NoteProps) {
eTarget: TaggedRawEvent,
isTargetAllowed: boolean = e.target === e.currentTarget
) {
if (!isTargetAllowed) {
if (!isTargetAllowed || opt?.canClick === false) {
return;
}
@ -280,7 +281,12 @@ export default function Note(props: NoteProps) {
<>
{options.showHeader && (
<div className="header flex">
<ProfileImage autoWidth={false} pubkey={ev.pubkey} subHeader={replyTag() ?? undefined} />
<ProfileImage
autoWidth={false}
pubkey={ev.pubkey}
subHeader={replyTag() ?? undefined}
linkToProfile={opt?.canClick === undefined}
/>
{(options.showTime || options.showBookmarked) && (
<div className="info">
{options.showBookmarked && (