update fix

This commit is contained in:
2025-12-19 11:32:50 +07:00
parent 47f154b326
commit e8d0ee3452
8 changed files with 67 additions and 43 deletions

37
src/app/(size)/layout.tsx Normal file
View 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
View 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 />
</>
);
}

View File

@@ -1 +0,0 @@
"use client";

View File

@@ -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>
);
}

View File

@@ -1,3 +0,0 @@
export default function Loading() {
return <p>Loading...</p>
}

View File

@@ -1,10 +0,0 @@
import React from 'react';
import Home from '@components/layout/home';
export default function Homepage() {
return (
<>
<Home />
</>
);
}

View 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;

View File

@@ -21,7 +21,8 @@
"paths": { "paths": {
"@/*": ["./*"], "@/*": ["./*"],
"@components/*": ["./src/components/*"], "@components/*": ["./src/components/*"],
"@types/*": ["./src/types/*"] "@types/*": ["./src/types/*"],
"@styles/*": ["./src/styles/*"]
} }
}, },
"include": [ "include": [