add user block

This commit is contained in:
Ren Amamiya
2023-07-17 17:00:01 +07:00
parent 7d38fa5d85
commit 100204b267
14 changed files with 299 additions and 66 deletions

View File

@@ -11,7 +11,15 @@ import { NoteZap } from '@shared/notes/actions/zap';
import { BLOCK_KINDS } from '@stores/constants';
export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) {
export function NoteActions({
id,
pubkey,
noOpenThread,
}: {
id: string;
pubkey: string;
noOpenThread?: boolean;
}) {
const queryClient = useQueryClient();
const block = useMutation({
@@ -36,24 +44,28 @@ export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) {
<NoteRepost id={id} pubkey={pubkey} />
<NoteZap />
</div>
<div className="mx-2 block h-4 w-px bg-zinc-800" />
<Tooltip.Root delayDuration={150}>
<Tooltip.Trigger asChild>
<button
type="button"
onClick={() => openThread(id)}
className="group inline-flex h-7 w-7 items-center justify-center"
>
<ThreadIcon className="h-5 w-5 text-zinc-300 group-hover:text-fuchsia-400" />
</button>
</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content className="-left-10 select-none rounded-md border-t border-zinc-600/50 bg-zinc-700 px-3.5 py-1.5 text-sm leading-none text-zinc-100 backdrop-blur-lg will-change-[transform,opacity] data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade">
Open thread
<Tooltip.Arrow className="fill-zinc-700" />
</Tooltip.Content>
</Tooltip.Portal>
</Tooltip.Root>
{!noOpenThread && (
<>
<div className="mx-2 block h-4 w-px bg-zinc-800" />
<Tooltip.Root delayDuration={150}>
<Tooltip.Trigger asChild>
<button
type="button"
onClick={() => openThread(id)}
className="group inline-flex h-7 w-7 items-center justify-center"
>
<ThreadIcon className="h-5 w-5 text-zinc-300 group-hover:text-fuchsia-400" />
</button>
</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content className="-left-10 select-none rounded-md border-t border-zinc-600/50 bg-zinc-700 px-3.5 py-1.5 text-sm leading-none text-zinc-100 backdrop-blur-lg will-change-[transform,opacity] data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade">
Open thread
<Tooltip.Arrow className="fill-zinc-700" />
</Tooltip.Content>
</Tooltip.Portal>
</Tooltip.Root>
</>
)}
</div>
</Tooltip.Provider>
);