feat(rail): edit title & open user notes

This commit is contained in:
Fernando López Guevara
2024-01-06 11:38:34 -03:00
parent a93ebd3861
commit 2e23b3ae06
12 changed files with 129 additions and 23 deletions

View File

@@ -7,9 +7,14 @@ import { Link } from 'react-router-dom';
import { HorizontalDotsIcon } from '@shared/icons';
import { WIDGET_KIND } from '@utils/constants';
import { useWidget } from '@utils/hooks/useWidget';
export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) {
const [open, setOpen] = useState(false);
const { addWidget } = useWidget();
const copyID = async () => {
await writeText(nip19.neventEncode({ id: id, author: pubkey } as EventPointer));
setOpen(false);
@@ -49,6 +54,21 @@ export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) {
Copy ID
</button>
</DropdownMenu.Item>
<DropdownMenu.Item asChild>
<button
type="button"
className="inline-flex h-10 items-center px-4 text-sm text-neutral-900 hover:bg-neutral-200 focus:outline-none dark:text-neutral-100 dark:hover:bg-neutral-800"
onClick={() =>
addWidget.mutate({
kind: WIDGET_KIND.user,
title: pubkey,
content: pubkey,
})
}
>
Open Notes
</button>
</DropdownMenu.Item>
<DropdownMenu.Item asChild>
<Link
to={`/users/${pubkey}`}