bug: render naddr link
This commit is contained in:
parent
cc4cda64f4
commit
5736bad21f
@ -9,11 +9,11 @@ export default function NostrLink({ link }: { link: string }) {
|
|||||||
|
|
||||||
if (nav?.type === NostrPrefix.PublicKey || nav?.type === NostrPrefix.Profile) {
|
if (nav?.type === NostrPrefix.PublicKey || nav?.type === NostrPrefix.Profile) {
|
||||||
return <Mention pubkey={nav.id} relays={nav.relays} />;
|
return <Mention pubkey={nav.id} relays={nav.relays} />;
|
||||||
} else if (nav?.type === NostrPrefix.Note || nav?.type === NostrPrefix.Event) {
|
} else if (nav?.type === NostrPrefix.Note || nav?.type === NostrPrefix.Event || nav?.type === NostrPrefix.Address) {
|
||||||
const evLink = eventLink(nav.id, nav.relays);
|
const evLink = nav.encode();
|
||||||
return (
|
return (
|
||||||
<Link to={evLink} onClick={e => e.stopPropagation()} state={{ from: location.pathname }}>
|
<Link to={`/e/${evLink}`} onClick={e => e.stopPropagation()} state={{ from: location.pathname }}>
|
||||||
#{evLink.split("/").at(-1)?.substring(0, 12)}
|
#{evLink.substring(0, 12)}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user