Skip to content

Commit

Permalink
add suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
imhson committed Mar 13, 2024
1 parent f3aa222 commit b657c23
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Header } from '@/components/header'
import './globals.css'
import Image from 'next/image'
import Bg from '@/assets/bg.png'
import { Suspense } from 'react'
const roboto = Roboto({
subsets: ['latin'],
weight: ['100', '300', '400', '500', '700', '900'],
Expand Down Expand Up @@ -43,13 +44,15 @@ export default function RootLayout({
return (
<html lang='en'>
<body className={`${roboto.variable} bg-[#100302] overflow-x-hidden w-[100vw] min-h-[100dvh] min-w-[375px]`}>
<ContextProvider>
<Header />
<main className='relative min-w-[100dvw] min-h-[100dvh]'>
<Image src={Bg} alt='' className='absolute inset-0 w-full h-full object-cover' />
<div className='relative'>{children}</div>
</main>
</ContextProvider>
<Suspense>
<ContextProvider>
<Header />
<main className='relative min-w-[100dvw] min-h-[100dvh]'>
<Image src={Bg} alt='' className='absolute inset-0 w-full h-full object-cover' />
<div className='relative'>{children}</div>
</main>
</ContextProvider>
</Suspense>
</body>
</html>
)
Expand Down

0 comments on commit b657c23

Please sign in to comment.