refactor: reorganize layout structure by moving Header and Footer components to RootLayout

This commit is contained in:
ArraysID
2025-05-10 13:20:43 +07:00
parent da0e599b9a
commit a800b1e293
3 changed files with 24 additions and 18 deletions
@@ -134,9 +134,15 @@ export function Header() {
> >
Testimoni Testimoni
</Link> </Link>
<Button className="mt-4 bg-gradient-to-r from-primary to-blue-400 hover:from-primary/90 hover:to-blue-400/90"> <a
Gabung Discord href="https://discord.com/invite/imphnen"
</Button> target="_blank"
className="mt-4"
>
<Button className="bg-gradient-to-r from-primary to-blue-400 hover:from-primary/90 hover:to-blue-400/90">
Gabung Discord
</Button>
</a>
</nav> </nav>
</div> </div>
)} )}
+7 -1
View File
@@ -1,6 +1,8 @@
import { type Metadata } from 'next'; import { type Metadata } from 'next';
import { Inter } from 'next/font/google'; import { Inter } from 'next/font/google';
import '../../styles/globals.css'; import '../../styles/globals.css';
import Footer from './_components/footer';
import { Header } from './_components/header';
import { ThemeProvider } from './_components/theme-provider'; import { ThemeProvider } from './_components/theme-provider';
const inter = Inter({ subsets: ['latin'] }); const inter = Inter({ subsets: ['latin'] });
@@ -24,7 +26,11 @@ export default function RootLayout({
enableSystem enableSystem
disableTransitionOnChange disableTransitionOnChange
> >
{children} <div className="flex min-h-screen flex-col">
<Header />
<main className="flex-1">{children}</main>
<Footer />
</div>
</ThemeProvider> </ThemeProvider>
</body> </body>
</html> </html>
+8 -14
View File
@@ -5,8 +5,6 @@ import { getGlobalsLearningResourcesSection } from '../../services/get-globals-l
import { CallToAction } from './_components/call-to-action'; import { CallToAction } from './_components/call-to-action';
import { Community } from './_components/community'; import { Community } from './_components/community';
import { Features } from './_components/features'; import { Features } from './_components/features';
import Footer from './_components/footer';
import { Header } from './_components/header';
import { Hero } from './_components/hero'; import { Hero } from './_components/hero';
import { LearningResources } from './_components/learning-resources'; import { LearningResources } from './_components/learning-resources';
import { Testimonials } from './_components/testimonials'; import { Testimonials } from './_components/testimonials';
@@ -23,17 +21,13 @@ export default async function Page() {
]); ]);
return ( return (
<div className="flex min-h-screen flex-col"> <>
<Header /> <Hero {...heroData} />
<main className="flex-1"> <Features {...featuresData} />
<Hero {...heroData} /> <Community {...communitiesData} />
<Features {...featuresData} /> <LearningResources {...learningResourcesData} />
<Community {...communitiesData} /> <Testimonials />
<LearningResources {...learningResourcesData} /> <CallToAction />
<Testimonials /> </>
<CallToAction />
</main>
<Footer />
</div>
); );
} }