update
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
'use client';
|
||||
import { useState, useEffect } from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import '@styles/sf-pro-display.css';
|
||||
import 'swiper/css';
|
||||
import 'swiper/css/navigation';
|
||||
@@ -7,32 +6,44 @@ import 'swiper/css/pagination';
|
||||
import '@styles/globals.css';
|
||||
import Header from '@/components/Other/Header';
|
||||
import Footer from '@/components/Other/Footer';
|
||||
import MSWProvider from '@/components/Common/MSWProvider';
|
||||
import { ErrorBoundary } from '@/components/Common/ErrorBoundary';
|
||||
|
||||
import PreLoader from '@/components/Common/PreLoader';
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
default: 'Nguyễn Công PC - Máy tính, Laptop, Linh kiện chính hãng',
|
||||
template: '%s | Nguyễn Công PC',
|
||||
},
|
||||
description:
|
||||
'Nguyễn Công PC - Chuyên cung cấp máy tính, laptop, linh kiện, phụ kiện chính hãng với giá tốt nhất thị trường. Bảo hành uy tín, giao hàng nhanh toàn quốc.',
|
||||
keywords: ['máy tính', 'laptop', 'linh kiện máy tính', 'nguyễn công pc', 'pc gaming'],
|
||||
authors: [{ name: 'Nguyễn Công PC' }],
|
||||
openGraph: {
|
||||
type: 'website',
|
||||
locale: 'vi_VN',
|
||||
siteName: 'Nguyễn Công PC',
|
||||
title: 'Nguyễn Công PC - Máy tính, Laptop, Linh kiện chính hãng',
|
||||
description:
|
||||
'Chuyên cung cấp máy tính, laptop, linh kiện, phụ kiện chính hãng với giá tốt nhất.',
|
||||
},
|
||||
robots: { index: true, follow: true },
|
||||
};
|
||||
|
||||
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 />
|
||||
</>
|
||||
)}
|
||||
<Header />
|
||||
<MSWProvider>
|
||||
<main>
|
||||
<ErrorBoundary>{children}</ErrorBoundary>
|
||||
</main>
|
||||
</MSWProvider>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user