Skip to content

Commit

Permalink
Wrap layout with Suspense with Loading
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszmanczak04 committed Sep 17, 2024
1 parent 4af1047 commit 96d3090
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { SpeedInsights } from '@vercel/speed-insights/next';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import MainLayout from '../components/common/main-layout';
import { Suspense } from 'react';
import Loading from './loading';

const inter = Inter({ subsets: ['latin'] });

Expand Down Expand Up @@ -51,7 +53,9 @@ export default async function RootLayout({
inter.className,
'bg-neutral-100 fill-neutral-800 text-neutral-800 dark:bg-neutral-900 dark:fill-neutral-100 dark:text-neutral-100',
)}>
<MainLayout>{children}</MainLayout>
<MainLayout>
<Suspense fallback={<Loading />}>{children}</Suspense>
</MainLayout>
<p className='fixed inset-x-0 bottom-0 z-50 bg-black text-center text-white'>
This app is still in development stage
</p>
Expand Down

0 comments on commit 96d3090

Please sign in to comment.