From f4b3fb54a984277f775fb8e98b3386c3e61721ab Mon Sep 17 00:00:00 2001 From: refansa Date: Sat, 3 Aug 2024 10:43:03 +0700 Subject: [PATCH] refactor: create default layout for common pages --- src/app/blog/page.tsx | 9 +++------ src/app/not-found.tsx | 7 +++---- src/app/page.tsx | 11 ++++------- src/app/projects/page.tsx | 9 +++------ src/components/blocks/footer/footer.tsx | 2 +- src/components/layouts/DefaultLayout.tsx | 18 ++++++++++++++++++ 6 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 src/components/layouts/DefaultLayout.tsx diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx index c5264b7..6ddad9a 100644 --- a/src/app/blog/page.tsx +++ b/src/app/blog/page.tsx @@ -1,7 +1,6 @@ import { Metadata } from 'next' -import Header from '@/components/blocks/header/header' -import Footer from '@/components/blocks/footer/footer' +import DefaultLayout from '@/components/layouts/DefaultLayout' import UnderConstruction from '@/components/blocks/error/under-construction' export const metadata: Metadata = { @@ -10,12 +9,10 @@ export const metadata: Metadata = { export default function Blog() { return ( -
-
+
-
-
+ ) } diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index efa64ec..c4b3d51 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -1,6 +1,6 @@ import { Metadata } from 'next' -import Header from '@/components/blocks/header/header' +import DefaultLayout from '@/components/layouts/DefaultLayout' import PageNotFound from '@/components/blocks/error/page-not-found' export const metadata: Metadata = { @@ -9,11 +9,10 @@ export const metadata: Metadata = { export default function NotFound() { return ( -
-
+
-
+ ) } diff --git a/src/app/page.tsx b/src/app/page.tsx index 4dd6844..43d070d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,19 +1,16 @@ -import Header from '@/components/blocks/header/header' -import Footer from '@/components/blocks/footer/footer' +import DefaultLayout from '@/components/layouts/DefaultLayout' +import IntroductionSection from '@/components/blocks/home/introduction-section' import AboutSection from '@/components/blocks/home/about-section' import ContactSection from '@/components/blocks/home/contact-section' -import IntroductionSection from '@/components/blocks/home/introduction-section' export default function Home() { return ( -
-
+
-
-
+ ) } diff --git a/src/app/projects/page.tsx b/src/app/projects/page.tsx index 4157402..3443f09 100644 --- a/src/app/projects/page.tsx +++ b/src/app/projects/page.tsx @@ -1,7 +1,6 @@ import { Metadata } from 'next' -import Header from '@/components/blocks/header/header' -import Footer from '@/components/blocks/footer/footer' +import DefaultLayout from '@/components/layouts/DefaultLayout' import UnderConstruction from '@/components/blocks/error/under-construction' export const metadata: Metadata = { @@ -10,12 +9,10 @@ export const metadata: Metadata = { export default function Projects() { return ( -
-
+
-
-
+ ) } diff --git a/src/components/blocks/footer/footer.tsx b/src/components/blocks/footer/footer.tsx index 6f39a69..0e57b3e 100644 --- a/src/components/blocks/footer/footer.tsx +++ b/src/components/blocks/footer/footer.tsx @@ -3,7 +3,7 @@ import Package from '../../../../package.json' export default function Footer() { return ( -