mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-26 11:37:40 +02:00
use embed event component instead of quote note
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import { EmbedableContent, embedJSX } from "../../helpers/embeds";
|
|
||||||
import { DraftNostrEvent, NostrEvent } from "../../types/nostr-event";
|
|
||||||
import QuoteNote from "../note/quote-note";
|
|
||||||
import { UserLink } from "../user-link";
|
|
||||||
import { Link } from "@chakra-ui/react";
|
import { Link } from "@chakra-ui/react";
|
||||||
import { Link as RouterLink } from "react-router-dom";
|
import { Link as RouterLink } from "react-router-dom";
|
||||||
|
|
||||||
|
import { EmbedableContent, embedJSX } from "../../helpers/embeds";
|
||||||
|
import { DraftNostrEvent, NostrEvent } from "../../types/nostr-event";
|
||||||
|
import { UserLink } from "../user-link";
|
||||||
import { getMatchHashtag, getMatchNostrLink, stripInvisibleChar } from "../../helpers/regexp";
|
import { getMatchHashtag, getMatchNostrLink, stripInvisibleChar } from "../../helpers/regexp";
|
||||||
import { safeDecode } from "../../helpers/nip19";
|
import { safeDecode } from "../../helpers/nip19";
|
||||||
import { EmbedEventPointer } from "../embed-event";
|
import { EmbedEventPointer } from "../embed-event";
|
||||||
@@ -48,7 +48,11 @@ export function embedNostrMentions(content: EmbedableContent, event: NostrEvent
|
|||||||
return <UserLink color="blue.500" pubkey={tag[1]} showAt />;
|
return <UserLink color="blue.500" pubkey={tag[1]} showAt />;
|
||||||
}
|
}
|
||||||
if (tag[0] === "e" && tag[1]) {
|
if (tag[0] === "e" && tag[1]) {
|
||||||
return <QuoteNote noteId={tag[1]} relays={tag[2] ? [tag[2]] : undefined} />;
|
return (
|
||||||
|
<EmbedEventPointer
|
||||||
|
pointer={{ type: "nevent", data: { id: tag[1], relays: tag[2] ? [tag[2]] : undefined } }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,6 @@ import { NostrEvent } from "../../../types/nostr-event";
|
|||||||
import { RepostIcon } from "../../icons";
|
import { RepostIcon } from "../../icons";
|
||||||
import { buildRepost } from "../../../helpers/nostr/events";
|
import { buildRepost } from "../../../helpers/nostr/events";
|
||||||
import clientRelaysService from "../../../services/client-relays";
|
import clientRelaysService from "../../../services/client-relays";
|
||||||
import QuoteNote from "../quote-note";
|
|
||||||
import NostrPublishAction from "../../../classes/nostr-publish-action";
|
import NostrPublishAction from "../../../classes/nostr-publish-action";
|
||||||
import { useSigningContext } from "../../../providers/signing-provider";
|
import { useSigningContext } from "../../../providers/signing-provider";
|
||||||
import { EmbedEvent } from "../../embed-event";
|
import { EmbedEvent } from "../../embed-event";
|
||||||
|
@@ -22,7 +22,7 @@ import { EventRelays } from "./note-relays";
|
|||||||
import { UserLink } from "../user-link";
|
import { UserLink } from "../user-link";
|
||||||
import { UserDnsIdentityIcon } from "../user-dns-identity-icon";
|
import { UserDnsIdentityIcon } from "../user-dns-identity-icon";
|
||||||
import NoteZapButton from "./note-zap-button";
|
import NoteZapButton from "./note-zap-button";
|
||||||
import { ExpandProvider } from "./expanded";
|
import { ExpandProvider } from "../../providers/expanded";
|
||||||
import useSubject from "../../hooks/use-subject";
|
import useSubject from "../../hooks/use-subject";
|
||||||
import appSettings from "../../services/settings/app-settings";
|
import appSettings from "../../services/settings/app-settings";
|
||||||
import EventVerificationIcon from "../event-verification-icon";
|
import EventVerificationIcon from "../event-verification-icon";
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { NostrEvent } from "../../types/nostr-event";
|
import { NostrEvent } from "../../types/nostr-event";
|
||||||
|
|
||||||
import { NoteContents } from "./note-contents";
|
import { NoteContents } from "./note-contents";
|
||||||
import { useExpand } from "./expanded";
|
import { useExpand } from "../../providers/expanded";
|
||||||
import SensitiveContentWarning from "../sensitive-content-warning";
|
import SensitiveContentWarning from "../sensitive-content-warning";
|
||||||
import useAppSettings from "../../hooks/use-app-settings";
|
import useAppSettings from "../../hooks/use-app-settings";
|
||||||
|
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
import { useReadRelayUrls } from "../../hooks/use-client-relays";
|
|
||||||
import useSingleEvent from "../../hooks/use-single-event";
|
|
||||||
import EmbeddedNote from "../embed-event/event-types/embedded-note";
|
|
||||||
import { NoteLink } from "../note-link";
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
const QuoteNote = ({ noteId, relays }: { noteId: string; relays?: string[] }) => {
|
|
||||||
const readRelays = useReadRelayUrls(relays);
|
|
||||||
const { event, loading } = useSingleEvent(noteId, readRelays);
|
|
||||||
|
|
||||||
return event ? <EmbeddedNote event={event} /> : <NoteLink noteId={noteId} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default QuoteNote;
|
|
@@ -9,7 +9,7 @@ import {
|
|||||||
useBreakpointValue,
|
useBreakpointValue,
|
||||||
useModal,
|
useModal,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { useExpand } from "./note/expanded";
|
import { useExpand } from "../providers/expanded";
|
||||||
|
|
||||||
export default function SensitiveContentWarning({ description }: { description: string } & AlertProps) {
|
export default function SensitiveContentWarning({ description }: { description: string } & AlertProps) {
|
||||||
const expand = useExpand();
|
const expand = useExpand();
|
||||||
|
Reference in New Issue
Block a user