requested changes.

This commit is contained in:
fiatjaf 2023-11-23 14:50:41 -03:00
parent 2a4554fe74
commit a67aad1223
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
3 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,6 @@
import { Modal, ModalOverlay, ModalContent, ModalBody, ModalCloseButton, Flex } from "@chakra-ui/react";
import { ModalProps } from "@chakra-ui/react";
import { nip19 } from "nostr-tools";
import { NostrEvent, isATag } from "../../types/nostr-event";
import RawJson from "./raw-json";
@ -27,7 +28,8 @@ export default function CommunityPostDebugModal({
<ModalBody p="4">
<Flex gap="2" direction="column">
<RawValue heading="Event Id" value={event.id} />
<RawValue heading="Pointer (NIP-19)" value={getSharableEventAddress(event)} />
<RawValue heading="NIP-19 Encoded Id" value={nip19.noteEncode(event.id)} />
<RawValue heading="NIP-19 Pointer" value={getSharableEventAddress(event)} />
<RawValue heading="Community Coordinate" value={communityCoordinate} />
<RawPre heading="Content" value={event.content} />
<RawJson heading="JSON" json={event} />

View File

@ -1,5 +1,6 @@
import { Modal, ModalOverlay, ModalContent, ModalBody, ModalCloseButton, Flex } from "@chakra-ui/react";
import { ModalProps } from "@chakra-ui/react";
import { nip19 } from "nostr-tools";
import { getReferences } from "../../helpers/nostr/events";
import { NostrEvent } from "../../types/nostr-event";
@ -17,7 +18,8 @@ export default function NoteDebugModal({ event, ...props }: { event: NostrEvent
<ModalBody p="4">
<Flex gap="2" direction="column">
<RawValue heading="Event Id" value={event.id} />
<RawValue heading="Pointer (NIP-19)" value={getSharableEventAddress(event)} />
<RawValue heading="NIP-19 Encoded Id" value={nip19.noteEncode(event.id)} />
<RawValue heading="NIP-19 Pointer" value={getSharableEventAddress(event)} />
<RawPre heading="Content" value={event.content} />
<RawJson heading="JSON" json={event} />
<RawJson heading="References" json={getReferences(event)} />

View File

@ -55,7 +55,10 @@ export default function CommunityPostMenu({
<MenuItem onClick={() => window.navigator.clipboard.writeText("nostr:" + address)} icon={<RepostIcon />}>
Copy Share Link
</MenuItem>
<MenuItem onClick={() => window.navigator.clipboard.writeText(event.id)} icon={<CopyToClipboardIcon />}>
<MenuItem
onClick={() => window.navigator.clipboard.writeText(nip19.noteEncode(event.id))}
icon={<CopyToClipboardIcon />}
>
Copy Note ID
</MenuItem>
{account?.pubkey === event.pubkey && (