refactor newsfeed and note
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import BaseLayout from '@layouts/base';
|
||||
import WithSidebarLayout from '@layouts/withSidebar';
|
||||
|
||||
import { Content } from '@components/note/content';
|
||||
import { ContentExtend } from '@components/note/content/extend';
|
||||
import { NoteExtend } from '@components/note/extend';
|
||||
import FormComment from '@components/note/form/comment';
|
||||
import { RelayContext } from '@components/relaysProvider';
|
||||
|
||||
@@ -11,7 +10,6 @@ import { relaysAtom } from '@stores/relays';
|
||||
import { getNoteByID } from '@utils/storage';
|
||||
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { GetStaticPaths } from 'next';
|
||||
import { useRouter } from 'next/router';
|
||||
import {
|
||||
JSXElementConstructor,
|
||||
@@ -65,21 +63,13 @@ export default function Page() {
|
||||
return (
|
||||
<div className="scrollbar-hide flex h-full flex-col gap-2 overflow-y-auto py-5">
|
||||
<div className="flex h-min min-h-min w-full select-text flex-col px-3">
|
||||
{rootEvent && <ContentExtend data={rootEvent} />}
|
||||
{rootEvent && <NoteExtend event={rootEvent} />}
|
||||
</div>
|
||||
<div>
|
||||
<FormComment eventID={id} />
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
{comments.length > 0 &&
|
||||
comments.map((comment) => (
|
||||
<div
|
||||
key={comment.id}
|
||||
className="flex h-min min-h-min w-full select-text flex-col border-b border-zinc-800 px-3 py-5 hover:bg-black/20"
|
||||
>
|
||||
<Content data={comment} />
|
||||
</div>
|
||||
))}
|
||||
{comments.length > 0 && comments.map((comment) => <p key={comment.id}>{comment.content}</p>)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseLayout from '@layouts/base';
|
||||
import WithSidebarLayout from '@layouts/withSidebar';
|
||||
|
||||
import { Note } from '@components/note';
|
||||
import { NoteBase } from '@components/note/base';
|
||||
import FormBasic from '@components/note/form/basic';
|
||||
|
||||
import { hasNewerNoteAtom, notesAtom } from '@stores/note';
|
||||
@@ -52,7 +52,7 @@ export default function Page() {
|
||||
<div className="absolute top-0 left-0 w-full" style={{ transform: `translateY(${items[0].start}px)` }}>
|
||||
{items.map((virtualRow) => (
|
||||
<div key={virtualRow.key} data-index={virtualRow.index} ref={virtualizer.measureElement}>
|
||||
<Note event={data[virtualRow.index]} />
|
||||
<NoteBase event={data[virtualRow.index]} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user