small fixes

This commit is contained in:
Ren Amamiya 2023-08-07 09:07:53 +07:00
parent 02ff9e3b68
commit aa2a9851c3
4 changed files with 15 additions and 6 deletions

View File

@ -35,8 +35,8 @@ export function EventScreen() {
<NoteContent content={data.content} />
</div>
<div>
<NoteActions id={data.id} pubkey={data.pubkey} noOpenThread={true} />
<NoteStats id={data.id} />
<NoteActions id={id} pubkey={data.pubkey} noOpenThread={true} />
<NoteStats id={id} />
</div>
</div>
</div>

View File

@ -39,8 +39,12 @@ export function ThreadBlock({ params }: { params: Block }) {
<NoteContent content={data.content} />
</div>
<div>
<NoteActions id={data.id} pubkey={data.pubkey} noOpenThread={true} />
<NoteStats id={data.id} />
<NoteActions
id={params.content}
pubkey={data.pubkey}
noOpenThread={true}
/>
<NoteStats id={params.content} />
</div>
</div>
</div>

View File

@ -3,13 +3,17 @@ import * as Tooltip from '@radix-ui/react-tooltip';
import { writeText } from '@tauri-apps/plugin-clipboard-manager';
import { nip19 } from 'nostr-tools';
import { EventPointer } from 'nostr-tools/lib/nip19';
import { useState } from 'react';
import { Link } from 'react-router-dom';
import { HorizontalDotsIcon } from '@shared/icons';
export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) {
const [open, setOpen] = useState(false);
const copyID = async () => {
await writeText(nip19.neventEncode({ id: id, author: pubkey } as EventPointer));
setOpen(false);
};
const copyLink = async () => {
@ -17,10 +21,11 @@ export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) {
'https://nostr.com/' +
nip19.neventEncode({ id: id, author: pubkey } as EventPointer)
);
setOpen(false);
};
return (
<Popover.Root>
<Popover.Root open={open} onOpenChange={setOpen}>
<Tooltip.Root delayDuration={150}>
<Tooltip.Trigger asChild>
<Popover.Trigger asChild>

View File

@ -52,7 +52,7 @@ export function User({
<Popover.Root>
<div
className={twMerge(
'relative z-10 flex',
'relative z-30 flex',
size === 'small' ? 'items-center gap-2' : 'items-start gap-3'
)}
>