optimized loading feed content

This commit is contained in:
Ren Amamiya
2023-02-23 12:52:25 +07:00
parent 5210aa2fb8
commit fd66fde0e0
6 changed files with 33 additions and 48 deletions

View File

@@ -2,23 +2,14 @@ import Reaction from '@components/note/atoms/reaction';
import Reply from '@components/note/atoms/reply';
import RootUser from '@components/note/atoms/rootUser';
import { User } from '@components/note/atoms/user';
import Content from '@components/note/content';
import { Placeholder } from '@components/note/placeholder';
import RepostIcon from '@assets/icons/Repost';
import dynamic from 'next/dynamic';
import { useNostrEvents } from 'nostr-react';
import { memo } from 'react';
const DynamicContent = dynamic(() => import('@components/note/content'), {
ssr: false,
loading: () => (
<>
<p>Loading...</p>
</>
),
});
export const Repost = memo(function Repost({
eventUser,
sourceID,
@@ -48,7 +39,7 @@ export const Repost = memo(function Repost({
<User pubkey={events[0].pubkey} time={events[0].created_at} />
<div className="-mt-4 pl-[60px]">
<div className="flex flex-col gap-2">
<DynamicContent data={events[0].content} />
<Content data={events[0].content} />
<div className="-ml-1 flex items-center gap-8">
<Reply eventID={events[0].id} />
<Reaction eventID={events[0].id} eventPubkey={events[0].pubkey} />