update fix
This commit is contained in:
37
src/app/(size)/layout.tsx
Normal file
37
src/app/(size)/layout.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
'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/Header';
|
||||
|
||||
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 />
|
||||
{children}
|
||||
</>
|
||||
)}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
17
src/app/(size)/page.tsx
Normal file
17
src/app/(size)/page.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import Home from '@components/layout/home';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Nguyễn Công PC - Cửa Hàng Máy Tính PC Đồ Hoạ - PC Gaming chuyên nghiệp',
|
||||
description:
|
||||
'Mua máy tính đồ họa, PC gaming, máy tính văn phòng, laptop gaming, PC AI, Build PC, CPU, VGA, màn hình máy tính chính hãng tại Nguyễn Công PC giá rẻ nhất - Giảm giá 50%',
|
||||
};
|
||||
|
||||
export default function Homepage() {
|
||||
return (
|
||||
<>
|
||||
<Home />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
"use client";
|
||||
@@ -1,28 +0,0 @@
|
||||
import type { Metadata } from 'next';
|
||||
import '../styles/sf-pro-display.css';
|
||||
import 'swiper/css';
|
||||
import 'swiper/css/navigation';
|
||||
import 'swiper/css/pagination';
|
||||
import '../styles/globals.css';
|
||||
import Header from '@/src/components/layout/Header';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Nguyễn Công PC - Cửa Hàng Máy Tính PC Đồ Hoạ - PC Gaming chuyên nghiệp',
|
||||
description:
|
||||
'Mua máy tính đồ họa, PC gaming, máy tính văn phòng, laptop gaming, PC AI, Build PC, CPU, VGA, màn hình máy tính chính hãng tại Nguyễn Công PC giá rẻ nhất - Giảm giá 50%',
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html suppressHydrationWarning>
|
||||
<body>
|
||||
<Header />
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function Loading() {
|
||||
return <p>Loading...</p>
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import React from 'react';
|
||||
import Home from '@components/layout/home';
|
||||
|
||||
export default function Homepage() {
|
||||
return (
|
||||
<>
|
||||
<Home />
|
||||
</>
|
||||
);
|
||||
}
|
||||
11
src/components/common/PreLoader.tsx
Normal file
11
src/components/common/PreLoader.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
const PreLoader = () => {
|
||||
return (
|
||||
<div className="fixed top-0 left-0 z-999999 flex h-screen w-screen items-center justify-center bg-white">
|
||||
<div className="border-blue h-16 w-16 animate-spin rounded-full border-4 border-solid border-t-transparent"></div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PreLoader;
|
||||
Reference in New Issue
Block a user