diff --git a/src/app/note/components/parent.tsx b/src/app/note/components/parent.tsx
index 85ab2a55..a4f7d7c7 100644
--- a/src/app/note/components/parent.tsx
+++ b/src/app/note/components/parent.tsx
@@ -1,11 +1,9 @@
-import { ContentMarkdown } from '@lume/app/note/components/markdown';
+import { NoteContent } from '@lume/app/note/components/content';
import NoteMetadata from '@lume/app/note/components/metadata';
-import { noteParser } from '@lume/app/note/components/parser';
-import ImagePreview from '@lume/app/note/components/preview/image';
-import VideoPreview from '@lume/app/note/components/preview/video';
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
import { RelayContext } from '@lume/shared/relayProvider';
import { READONLY_RELAYS } from '@lume/stores/constants';
+import { noteParser } from '@lume/utils/parser';
import { memo, useContext } from 'react';
import useSWRSubscription from 'swr/subscription';
@@ -72,12 +70,7 @@ export const NoteParent = memo(function NoteParent({ id }: { id: string }) {
diff --git a/src/app/note/components/preview/image.tsx b/src/app/note/components/preview/image.tsx
index a736e3a2..47204a09 100644
--- a/src/app/note/components/preview/image.tsx
+++ b/src/app/note/components/preview/image.tsx
@@ -2,28 +2,15 @@ import { Image } from '@lume/shared/image';
export default function ImagePreview({ urls }: { urls: string[] }) {
return (
-
- {urls.length === 1 ? (
-
-
-
- ) : (
- urls.map((url: string) => (
-
-
-
- ))
- )}
+
);
}
diff --git a/src/app/note/components/preview/video.tsx b/src/app/note/components/preview/video.tsx
index 3cdfc180..4bd0fc66 100644
--- a/src/app/note/components/preview/video.tsx
+++ b/src/app/note/components/preview/video.tsx
@@ -4,7 +4,7 @@ export default function VideoPreview({ urls }: { urls: string[] }) {
return (
e.stopPropagation()}
- className="relative mt-2 flex w-full flex-col overflow-hidden rounded-lg bg-zinc-950"
+ className="relative mt-3 flex w-full flex-col overflow-hidden rounded-lg bg-zinc-950"
>
diff --git a/src/app/note/components/quote.tsx b/src/app/note/components/quote.tsx
index 6d1e1fe3..b9c9a744 100644
--- a/src/app/note/components/quote.tsx
+++ b/src/app/note/components/quote.tsx
@@ -1,10 +1,8 @@
-import { ContentMarkdown } from '@lume/app/note/components/markdown';
-import { noteParser } from '@lume/app/note/components/parser';
-import ImagePreview from '@lume/app/note/components/preview/image';
-import VideoPreview from '@lume/app/note/components/preview/video';
+import { NoteContent } from '@lume/app/note/components/content';
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
import { RelayContext } from '@lume/shared/relayProvider';
import { READONLY_RELAYS } from '@lume/stores/constants';
+import { noteParser } from '@lume/utils/parser';
import { memo, useContext } from 'react';
import useSWRSubscription from 'swr/subscription';
@@ -36,6 +34,8 @@ export const NoteQuote = memo(function NoteQuote({ id }: { id: string }) {
};
});
+ const content = !error && data ? noteParser(data) : null;
+
const openNote = (e) => {
const selection = window.getSelection();
if (selection.toString().length === 0) {
@@ -45,8 +45,6 @@ export const NoteQuote = memo(function NoteQuote({ id }: { id: string }) {
}
};
- const content = !error && data ? noteParser(data) : null;
-
return (
openNote(e)}
@@ -59,9 +57,7 @@ export const NoteQuote = memo(function NoteQuote({ id }: { id: string }) {
-
- {Array.isArray(content.images) && content.images.length ? : <>>}
- {Array.isArray(content.videos) && content.videos.length ? : <>>}
+
)}
diff --git a/src/app/note/components/formReply.tsx b/src/app/note/components/replies/form.tsx
similarity index 100%
rename from src/app/note/components/formReply.tsx
rename to src/app/note/components/replies/form.tsx
diff --git a/src/app/note/components/replies/item.tsx b/src/app/note/components/replies/item.tsx
new file mode 100644
index 00000000..56b02bc8
--- /dev/null
+++ b/src/app/note/components/replies/item.tsx
@@ -0,0 +1,18 @@
+import { NoteContent } from '@lume/app/note/components/content';
+import NoteReplyUser from '@lume/app/note/components/user/reply';
+import { noteParser } from '@lume/utils/parser';
+
+export default function Reply({ data }: { data: any }) {
+ const content = noteParser(data);
+
+ return (
+
+ );
+}
diff --git a/src/app/note/components/replies.tsx b/src/app/note/components/replies/list.tsx
similarity index 88%
rename from src/app/note/components/replies.tsx
rename to src/app/note/components/replies/list.tsx
index 60375ed7..1e7b132d 100644
--- a/src/app/note/components/replies.tsx
+++ b/src/app/note/components/replies/list.tsx
@@ -1,5 +1,5 @@
-import NoteReplyForm from '@lume/app/note/components/formReply';
-import NoteReply from '@lume/app/note/components/reply';
+import NoteReplyForm from '@lume/app/note/components/replies/form';
+import Reply from '@lume/app/note/components/replies/item';
import { RelayContext } from '@lume/shared/relayProvider';
import { READONLY_RELAYS } from '@lume/stores/constants';
import { sortEvents } from '@lume/utils/transform';
@@ -7,7 +7,7 @@ import { sortEvents } from '@lume/utils/transform';
import { useContext } from 'react';
import useSWRSubscription from 'swr/subscription';
-export default function NoteReplies({ id }: { id: string }) {
+export default function RepliesList({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const { data, error } = useSWRSubscription(id ? ['note-replies', id] : null, ([, key], { next }) => {
@@ -53,7 +53,7 @@ export default function NoteReplies({ id }: { id: string }) {
) : (
sortEvents(data).map((event: any) => {
- return ;
+ return ;
})
)}
diff --git a/src/app/note/components/reply.tsx b/src/app/note/components/reply.tsx
deleted file mode 100644
index 79e4a1aa..00000000
--- a/src/app/note/components/reply.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { noteParser } from '@lume/app/note/components//parser';
-import { ContentMarkdown } from '@lume/app/note/components/markdown';
-import ImagePreview from '@lume/app/note/components/preview/image';
-import VideoPreview from '@lume/app/note/components/preview/video';
-import NoteReplyUser from '@lume/app/note/components/user/reply';
-
-export default function NoteReply({ data }: { data: any }) {
- const content = noteParser(data);
-
- return (
-
-
-
-
-
- {Array.isArray(content.images) && content.images.length ? : <>>}
- {Array.isArray(content.videos) && content.videos.length ? : <>>}
-
-
-
- );
-}
diff --git a/src/app/note/components/rootNote.tsx b/src/app/note/components/rootNote.tsx
index 5ef3280f..1d13c396 100644
--- a/src/app/note/components/rootNote.tsx
+++ b/src/app/note/components/rootNote.tsx
@@ -1,11 +1,9 @@
-import { ContentMarkdown } from '@lume/app/note/components/markdown';
+import { NoteContent } from '@lume/app/note/components/content';
import NoteMetadata from '@lume/app/note/components/metadata';
-import { noteParser } from '@lume/app/note/components/parser';
-import ImagePreview from '@lume/app/note/components/preview/image';
-import VideoPreview from '@lume/app/note/components/preview/video';
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
import { RelayContext } from '@lume/shared/relayProvider';
import { READONLY_RELAYS } from '@lume/stores/constants';
+import { noteParser } from '@lume/utils/parser';
import { memo, useContext } from 'react';
import useSWRSubscription from 'swr/subscription';
@@ -65,19 +63,7 @@ export const RootNote = memo(function RootNote({ id, fallback }: { id: string; f
openNote(e)} className="relative z-10 flex flex-col">
-
- {Array.isArray(contentFallback.images) && contentFallback.images.length ? (
-
- ) : (
- <>>
- )}
- {Array.isArray(contentFallback.videos) && contentFallback.videos.length ? (
-
- ) : (
- <>>
- )}
-
-
e.stopPropagation()} className="mt-5 pl-[52px]">
+
@@ -113,11 +99,7 @@ export const RootNote = memo(function RootNote({ id, fallback }: { id: string; f
openNote(e)} className="relative z-10 flex flex-col">
-
- {Array.isArray(content.images) && content.images.length ? : <>>}
- {Array.isArray(content.videos) && content.videos.length ? : <>>}
-
-
e.stopPropagation()} className="mt-5 pl-[52px]">
+
diff --git a/src/app/note/pages/index.page.tsx b/src/app/note/pages/index.page.tsx
index 93092189..f68c003a 100644
--- a/src/app/note/pages/index.page.tsx
+++ b/src/app/note/pages/index.page.tsx
@@ -1,12 +1,12 @@
import NoteMetadata from '@lume/app/note/components/metadata';
-import { noteParser } from '@lume/app/note/components/parser';
import ImagePreview from '@lume/app/note/components/preview/image';
import VideoPreview from '@lume/app/note/components/preview/video';
-import NoteReplies from '@lume/app/note/components/replies';
+import RepliesList from '@lume/app/note/components/replies/list';
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
import { RelayContext } from '@lume/shared/relayProvider';
import { READONLY_RELAYS } from '@lume/stores/constants';
import { usePageContext } from '@lume/utils/hooks/usePageContext';
+import { noteParser } from '@lume/utils/parser';
import { useContext } from 'react';
import useSWRSubscription from 'swr/subscription';
@@ -94,7 +94,7 @@ export function Page() {
>
)}