feat: render nip94 from regular note reference

This commit is contained in:
2023-04-21 23:46:22 +01:00
parent a31aa35490
commit 82956f3c69
5 changed files with 100 additions and 52 deletions

View File

@ -29,6 +29,7 @@ import Poll from "Element/Poll";
import { EventExt } from "System/EventExt";
import useLogin from "Hooks/useLogin";
import { setBookmarked, setPinned } from "Login";
import { NostrFileElement } from "Element/NostrFileHeader";
import messages from "./messages";
@ -72,8 +73,13 @@ const HiddenNote = ({ children }: { children: React.ReactNode }) => {
};
export default function Note(props: NoteProps) {
const navigate = useNavigate();
const { data: ev, related, highlight, options: opt, ignoreModeration = false } = props;
if (ev.kind === EventKind.FileHeader) {
return <NostrFileElement ev={ev} />;
}
const navigate = useNavigate();
const [showReactions, setShowReactions] = useState(false);
const deletions = useMemo(() => getReactions(related, ev.id, EventKind.Deletion), [related]);
const { isMuted } = useModeration();