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} /> <NoteContent content={data.content} />
</div> </div>
<div> <div>
<NoteActions id={data.id} pubkey={data.pubkey} noOpenThread={true} /> <NoteActions id={id} pubkey={data.pubkey} noOpenThread={true} />
<NoteStats id={data.id} /> <NoteStats id={id} />
</div> </div>
</div> </div>
</div> </div>

View File

@@ -39,8 +39,12 @@ export function ThreadBlock({ params }: { params: Block }) {
<NoteContent content={data.content} /> <NoteContent content={data.content} />
</div> </div>
<div> <div>
<NoteActions id={data.id} pubkey={data.pubkey} noOpenThread={true} /> <NoteActions
<NoteStats id={data.id} /> id={params.content}
pubkey={data.pubkey}
noOpenThread={true}
/>
<NoteStats id={params.content} />
</div> </div>
</div> </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 { writeText } from '@tauri-apps/plugin-clipboard-manager';
import { nip19 } from 'nostr-tools'; import { nip19 } from 'nostr-tools';
import { EventPointer } from 'nostr-tools/lib/nip19'; import { EventPointer } from 'nostr-tools/lib/nip19';
import { useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { HorizontalDotsIcon } from '@shared/icons'; import { HorizontalDotsIcon } from '@shared/icons';
export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) { export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) {
const [open, setOpen] = useState(false);
const copyID = async () => { const copyID = async () => {
await writeText(nip19.neventEncode({ id: id, author: pubkey } as EventPointer)); await writeText(nip19.neventEncode({ id: id, author: pubkey } as EventPointer));
setOpen(false);
}; };
const copyLink = async () => { const copyLink = async () => {
@@ -17,10 +21,11 @@ export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) {
'https://nostr.com/' + 'https://nostr.com/' +
nip19.neventEncode({ id: id, author: pubkey } as EventPointer) nip19.neventEncode({ id: id, author: pubkey } as EventPointer)
); );
setOpen(false);
}; };
return ( return (
<Popover.Root> <Popover.Root open={open} onOpenChange={setOpen}>
<Tooltip.Root delayDuration={150}> <Tooltip.Root delayDuration={150}>
<Tooltip.Trigger asChild> <Tooltip.Trigger asChild>
<Popover.Trigger asChild> <Popover.Trigger asChild>

View File

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