feat: root layout with fonts, Navbar, Footer

This commit is contained in:
achmad
2026-05-28 22:28:08 +07:00
parent ab7bbd3805
commit 6ba2c8b932
3 changed files with 43 additions and 28 deletions
+33 -27
View File
@@ -1,35 +1,41 @@
import type { Metadata } from "next"; import type { Metadata } from 'next'
import localFont from "next/font/local"; import { Inter } from 'next/font/google'
import "./globals.css"; import { Noto_Sans_JP } from 'next/font/google'
import './globals.css'
import Navbar from '@/components/layout/Navbar'
import Footer from '@/components/layout/Footer'
import SearchOverlay from '@/components/search/SearchOverlay'
const geistSans = localFont({ const inter = Inter({
src: "./fonts/GeistVF.woff", subsets: ['latin'],
variable: "--font-geist-sans", variable: '--font-inter',
weight: "100 900", display: 'swap',
}); })
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", const notoSansJP = Noto_Sans_JP({
variable: "--font-geist-mono", subsets: ['latin'],
weight: "100 900", variable: '--font-noto-sans-jp',
}); display: 'swap',
weight: ['400', '500', '600', '700'],
})
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Create Next App", title: {
description: "Generated by create next app", template: '%s — Kotobane',
}; default: 'Kotobane — Japanese Pop-Culture News',
},
description: 'VTubers, Anime, Manga, Games, Music, and Japanese culture news.',
}
export default function RootLayout({ export default function RootLayout({ children }: { children: React.ReactNode }) {
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return ( return (
<html lang="en"> <html lang="en" className={`${inter.variable} ${notoSansJP.variable}`}>
<body <body>
className={`${geistSans.variable} ${geistMono.variable} antialiased`} <Navbar />
> <main>{children}</main>
{children} <Footer />
<SearchOverlay />
</body> </body>
</html> </html>
); )
} }
+6 -1
View File
@@ -2,6 +2,11 @@ import { getAllCategories } from '@/lib/directus'
import NavbarClient from './NavbarClient' import NavbarClient from './NavbarClient'
export default async function Navbar() { export default async function Navbar() {
const categories = await getAllCategories() let categories: { id: string; name: string; slug: string; description: string | null }[] = []
try {
categories = await getAllCategories()
} catch {
// Directus not yet available — renders empty nav
}
return <NavbarClient categories={categories} /> return <NavbarClient categories={categories} />
} }
+4
View File
@@ -0,0 +1,4 @@
'use client'
export default function SearchOverlay() {
return null
}