refactor: create default layout for common pages
This commit is contained in:
parent
7bd2e47024
commit
f4b3fb54a9
@ -1,7 +1,6 @@
|
|||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
|
|
||||||
import Header from '@/components/blocks/header/header'
|
import DefaultLayout from '@/components/layouts/DefaultLayout'
|
||||||
import Footer from '@/components/blocks/footer/footer'
|
|
||||||
import UnderConstruction from '@/components/blocks/error/under-construction'
|
import UnderConstruction from '@/components/blocks/error/under-construction'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
@ -10,12 +9,10 @@ export const metadata: Metadata = {
|
|||||||
|
|
||||||
export default function Blog() {
|
export default function Blog() {
|
||||||
return (
|
return (
|
||||||
<div className="max-w-screen-lg w-full mx-auto px-6">
|
<DefaultLayout>
|
||||||
<Header />
|
|
||||||
<main className="flex justify-center items-center h-[85vh]">
|
<main className="flex justify-center items-center h-[85vh]">
|
||||||
<UnderConstruction />
|
<UnderConstruction />
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
</DefaultLayout>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Metadata } from 'next'
|
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'
|
import PageNotFound from '@/components/blocks/error/page-not-found'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
@ -9,11 +9,10 @@ export const metadata: Metadata = {
|
|||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
return (
|
return (
|
||||||
<div className="max-w-screen-lg w-full mx-auto px-6">
|
<DefaultLayout>
|
||||||
<Header />
|
|
||||||
<main className="flex justify-center items-center h-[85vh]">
|
<main className="flex justify-center items-center h-[85vh]">
|
||||||
<PageNotFound />
|
<PageNotFound />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</DefaultLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
import Header from '@/components/blocks/header/header'
|
import DefaultLayout from '@/components/layouts/DefaultLayout'
|
||||||
import Footer from '@/components/blocks/footer/footer'
|
import IntroductionSection from '@/components/blocks/home/introduction-section'
|
||||||
import AboutSection from '@/components/blocks/home/about-section'
|
import AboutSection from '@/components/blocks/home/about-section'
|
||||||
import ContactSection from '@/components/blocks/home/contact-section'
|
import ContactSection from '@/components/blocks/home/contact-section'
|
||||||
import IntroductionSection from '@/components/blocks/home/introduction-section'
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<div className="max-w-screen-lg w-full mx-auto px-6">
|
<DefaultLayout>
|
||||||
<Header />
|
|
||||||
<main className="flex flex-col gap-24 mb-24">
|
<main className="flex flex-col gap-24 mb-24">
|
||||||
<IntroductionSection />
|
<IntroductionSection />
|
||||||
<AboutSection />
|
<AboutSection />
|
||||||
<ContactSection />
|
<ContactSection />
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
</DefaultLayout>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
|
|
||||||
import Header from '@/components/blocks/header/header'
|
import DefaultLayout from '@/components/layouts/DefaultLayout'
|
||||||
import Footer from '@/components/blocks/footer/footer'
|
|
||||||
import UnderConstruction from '@/components/blocks/error/under-construction'
|
import UnderConstruction from '@/components/blocks/error/under-construction'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
@ -10,12 +9,10 @@ export const metadata: Metadata = {
|
|||||||
|
|
||||||
export default function Projects() {
|
export default function Projects() {
|
||||||
return (
|
return (
|
||||||
<div className="max-w-screen-lg w-full mx-auto px-6">
|
<DefaultLayout>
|
||||||
<Header />
|
|
||||||
<main className="flex justify-center items-center h-[85vh]">
|
<main className="flex justify-center items-center h-[85vh]">
|
||||||
<UnderConstruction />
|
<UnderConstruction />
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
</DefaultLayout>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import Package from '../../../../package.json'
|
|||||||
|
|
||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
return (
|
return (
|
||||||
<footer className="flex flex-col gap-1 items-center mb-8">
|
<footer className="flex flex-col gap-1 items-center mb-8 text-xs md:text-base">
|
||||||
<p className="font-semibold text-center">Site Version: {Package.version}</p>
|
<p className="font-semibold text-center">Site Version: {Package.version}</p>
|
||||||
<p className="font-semibold text-center">
|
<p className="font-semibold text-center">
|
||||||
Created with ❤️ by <Anchor href={Package.author.url}>{Package.author.nickname}</Anchor>
|
Created with ❤️ by <Anchor href={Package.author.url}>{Package.author.nickname}</Anchor>
|
||||||
|
18
src/components/layouts/DefaultLayout.tsx
Normal file
18
src/components/layouts/DefaultLayout.tsx
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { ReactNode } from 'react'
|
||||||
|
|
||||||
|
import Header from '@/components/blocks/header/header'
|
||||||
|
import Footer from '@/components/blocks/footer/footer'
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
children: ReactNode
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function DefaultLayout({ children }: Props) {
|
||||||
|
return (
|
||||||
|
<div className="max-w-screen-lg w-full mx-auto px-6">
|
||||||
|
<Header />
|
||||||
|
{children}
|
||||||
|
<Footer />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user