fix: note embeds
This commit is contained in:
parent
6cf144127a
commit
74c087525c
@ -1,7 +1,6 @@
|
||||
import "./note.css";
|
||||
import { lazy } from "react";
|
||||
import { type NostrEvent, NostrPrefix } from "@snort/system";
|
||||
import { hexToBech32 } from "@snort/shared";
|
||||
import { Suspense, lazy } from "react";
|
||||
import { type NostrEvent, NostrLink } from "@snort/system";
|
||||
|
||||
const Markdown = lazy(() => import("./markdown"));
|
||||
import { ExternalIconLink } from "./external-link";
|
||||
@ -15,11 +14,13 @@ export function Note({ ev }: { ev: NostrEvent }) {
|
||||
<ExternalIconLink
|
||||
size={24}
|
||||
className="note-link-icon"
|
||||
href={`https://snort.social/e/${hexToBech32(NostrPrefix.Event, ev.id)}`}
|
||||
href={`https://snort.social/e/${NostrLink.fromEvent(ev).encode()}`}
|
||||
/>
|
||||
</div>
|
||||
<div className="note-content">
|
||||
<Markdown tags={ev.tags} content={ev.content} />
|
||||
<Suspense>
|
||||
<Markdown tags={ev.tags} content={ev.content} />
|
||||
</Suspense>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -49,6 +49,10 @@ export function Text({ content, tags, eventComponent }: TextProps) {
|
||||
}
|
||||
case "mention":
|
||||
return <Mention pubkey={f.content} />;
|
||||
case "hashtag":
|
||||
return <Link to={`/t/${f.content}`}>
|
||||
#{f.content}
|
||||
</Link>
|
||||
default: {
|
||||
if (f.content.startsWith("lnurlp:")) {
|
||||
// LUD-17: https://github.com/lnurl/luds/blob/luds/17.md
|
||||
|
Loading…
x
Reference in New Issue
Block a user