diff --git a/src/shared/notes/kinds/text.tsx b/src/shared/notes/kinds/text.tsx index 06f75150..782d20e8 100644 --- a/src/shared/notes/kinds/text.tsx +++ b/src/shared/notes/kinds/text.tsx @@ -2,13 +2,13 @@ import { memo } from 'react'; import { useRichContent } from '@utils/hooks/useRichContent'; -export function TextKind({ content, truncate }: { content: string; truncate?: boolean }) { - const { parsedContent } = useRichContent(content); +export function TextKind({ content, textmode }: { content: string; textmode?: boolean }) { + const { parsedContent } = useRichContent(content, textmode); - if (truncate) { + if (textmode) { return ( -
- {content} +
+ {parsedContent}
); } diff --git a/src/shared/notes/mentions/note.tsx b/src/shared/notes/mentions/note.tsx index 39293319..0fac7fe1 100644 --- a/src/shared/notes/mentions/note.tsx +++ b/src/shared/notes/mentions/note.tsx @@ -1,7 +1,6 @@ import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; import { memo } from 'react'; -import { PlusIcon } from '@shared/icons'; import { MemoizedArticleKind, MemoizedFileKind, @@ -22,7 +21,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { const renderKind = (event: NDKEvent) => { switch (event.kind) { case NDKKind.Text: - return ; + return ; case NDKKind.Article: return ; case 1063: @@ -42,10 +41,25 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { return (
-
+
-
{renderKind(data)}
+
+ {renderKind(data)} + +
); }); diff --git a/src/shared/notes/notify.tsx b/src/shared/notes/notify.tsx index add7dfcd..0c8db6f5 100644 --- a/src/shared/notes/notify.tsx +++ b/src/shared/notes/notify.tsx @@ -2,7 +2,12 @@ import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; import { memo } from 'react'; import { ShareIcon } from '@shared/icons'; -import { MemoizedArticleKind, MemoizedFileKind, NoteSkeleton } from '@shared/notes'; +import { + MemoizedArticleKind, + MemoizedFileKind, + MemoizedTextKind, + NoteSkeleton, +} from '@shared/notes'; import { User } from '@shared/user'; import { WidgetKinds } from '@stores/constants'; @@ -21,11 +26,7 @@ export function NotifyNote({ event }: { event: NDKEvent }) { const renderKind = (event: NDKEvent) => { switch (event.kind) { case NDKKind.Text: - return ( -
- {event.content} -
- ); + return ; case NDKKind.Article: return ; case 1063: diff --git a/src/shared/notes/replies/form.tsx b/src/shared/notes/replies/form.tsx index 34255bf2..4d123ee7 100644 --- a/src/shared/notes/replies/form.tsx +++ b/src/shared/notes/replies/form.tsx @@ -3,19 +3,15 @@ import { useState } from 'react'; import { toast } from 'sonner'; import { useNDK } from '@libs/ndk/provider'; -import { useStorage } from '@libs/storage/provider'; import { ReplyMediaUploader } from '@shared/notes'; -import { User } from '@shared/user'; -export function NoteReplyForm({ id }: { id: string }) { - const { db } = useStorage(); +export function NoteReplyForm({ eventId }: { eventId: string }) { const { ndk, relayUrls } = useNDK(); - const [value, setValue] = useState(''); const submit = async () => { - const tags = [['e', id, relayUrls[0], 'root']]; + const tags = [['e', eventId, relayUrls[0], 'root']]; // publish event const event = new NDKEvent(ndk); @@ -31,26 +27,23 @@ export function NoteReplyForm({ id }: { id: string }) { }; return ( -
- -
-