From e8d0ee3452f149284a9f14565587e13068d90ba2 Mon Sep 17 00:00:00 2001 From: Tieptk Date: Fri, 19 Dec 2025 11:32:50 +0700 Subject: [PATCH] update fix --- src/app/(size)/layout.tsx | 37 +++++++++++++++++++++++++++++ src/app/(size)/page.tsx | 17 +++++++++++++ src/app/error.tsx | 1 - src/app/layout.tsx | 28 ---------------------- src/app/loading.tsx | 3 --- src/app/page.tsx | 10 -------- src/components/common/PreLoader.tsx | 11 +++++++++ tsconfig.json | 3 ++- 8 files changed, 67 insertions(+), 43 deletions(-) create mode 100644 src/app/(size)/layout.tsx create mode 100644 src/app/(size)/page.tsx delete mode 100644 src/app/error.tsx delete mode 100644 src/app/layout.tsx delete mode 100644 src/app/loading.tsx delete mode 100644 src/app/page.tsx create mode 100644 src/components/common/PreLoader.tsx diff --git a/src/app/(size)/layout.tsx b/src/app/(size)/layout.tsx new file mode 100644 index 0000000..1769752 --- /dev/null +++ b/src/app/(size)/layout.tsx @@ -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(true); + + useEffect(() => { + setTimeout(() => setLoading(false), 1000); + }, []); + + return ( + + + {loading ? ( + + ) : ( + <> +
+ {children} + + )} + + + ); +} diff --git a/src/app/(size)/page.tsx b/src/app/(size)/page.tsx new file mode 100644 index 0000000..f061c05 --- /dev/null +++ b/src/app/(size)/page.tsx @@ -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 ( + <> + + + ); +} diff --git a/src/app/error.tsx b/src/app/error.tsx deleted file mode 100644 index 2d4f31d..0000000 --- a/src/app/error.tsx +++ /dev/null @@ -1 +0,0 @@ -"use client"; \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx deleted file mode 100644 index cc904ca..0000000 --- a/src/app/layout.tsx +++ /dev/null @@ -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 ( - - -
- {children} - - - ); -} diff --git a/src/app/loading.tsx b/src/app/loading.tsx deleted file mode 100644 index da99859..0000000 --- a/src/app/loading.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function Loading() { - return

Loading...

-} \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx deleted file mode 100644 index 37c20cf..0000000 --- a/src/app/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import Home from '@components/layout/home'; - -export default function Homepage() { - return ( - <> - - - ); -} diff --git a/src/components/common/PreLoader.tsx b/src/components/common/PreLoader.tsx new file mode 100644 index 0000000..21a5233 --- /dev/null +++ b/src/components/common/PreLoader.tsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const PreLoader = () => { + return ( +
+
+
+ ); +}; + +export default PreLoader; diff --git a/tsconfig.json b/tsconfig.json index 607086d..ac7893c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,7 +21,8 @@ "paths": { "@/*": ["./*"], "@components/*": ["./src/components/*"], - "@types/*": ["./src/types/*"] + "@types/*": ["./src/types/*"], + "@styles/*": ["./src/styles/*"] } }, "include": [