home page converted back to server-side component
This commit is contained in:
19
app/page.tsx
19
app/page.tsx
@@ -1,11 +1,7 @@
|
||||
import { FC, Suspense } from 'react';
|
||||
import { Main } from './ui/Main';
|
||||
import dynamic from 'next/dynamic'
|
||||
|
||||
const HomePage = dynamic(
|
||||
() => import('./ui/HomePage'),
|
||||
{ ssr: false }
|
||||
)
|
||||
import HomePage from './ui/HomePage';
|
||||
import { MonthCardSkeleton } from './ui/MonthCardSkeleton';
|
||||
|
||||
export interface PageProps {
|
||||
searchParams?: {
|
||||
@@ -14,11 +10,20 @@ export interface PageProps {
|
||||
};
|
||||
}
|
||||
|
||||
const HomePageSkeleton = () =>
|
||||
<>
|
||||
<MonthCardSkeleton checked={true} />
|
||||
<MonthCardSkeleton />
|
||||
<MonthCardSkeleton />
|
||||
</>
|
||||
|
||||
const Page:FC<PageProps> = async ({ searchParams }) => {
|
||||
|
||||
return (
|
||||
<Main>
|
||||
<HomePage />
|
||||
<Suspense fallback={<HomePageSkeleton />}>
|
||||
<HomePage searchParams={searchParams} />
|
||||
</Suspense>
|
||||
</Main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user