update
This commit is contained in:
39
src/app/layout.tsx
Normal file
39
src/app/layout.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
'use client';
|
||||
import { useState, useEffect } from 'react';
|
||||
import '@styles/sf-pro-display.css';
|
||||
import 'swiper/css';
|
||||
import 'swiper/css/navigation';
|
||||
import 'swiper/css/pagination';
|
||||
import '@styles/globals.css';
|
||||
import Header from '@/components/layout/other/Header';
|
||||
import Footer from '@/components/layout/other/Footer';
|
||||
|
||||
import PreLoader from '@components/common/PreLoader';
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => setLoading(false), 1000);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<html suppressHydrationWarning>
|
||||
<body>
|
||||
{loading ? (
|
||||
<PreLoader />
|
||||
) : (
|
||||
<>
|
||||
<Header />
|
||||
<main>{children}</main>
|
||||
<Footer />
|
||||
</>
|
||||
)}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user