Add dark theme root layout with Inter font and nav bar
This commit is contained in:
@@ -1,21 +1,30 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Geist, Geist_Mono } from "next/font/google";
|
import { Inter } from "next/font/google";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { usePathname } from "next/navigation";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
|
||||||
const geistSans = Geist({
|
const inter = Inter({
|
||||||
variable: "--font-geist-sans",
|
|
||||||
subsets: ["latin"],
|
subsets: ["latin"],
|
||||||
|
variable: "--font-inter",
|
||||||
});
|
});
|
||||||
|
|
||||||
const geistMono = Geist_Mono({
|
function NavLink({ href, children }: { href: string; children: React.ReactNode }) {
|
||||||
variable: "--font-geist-mono",
|
const pathname = usePathname();
|
||||||
subsets: ["latin"],
|
const isActive = pathname === href || (href !== "/" && pathname.startsWith(href));
|
||||||
});
|
return (
|
||||||
|
<Link
|
||||||
export const metadata: Metadata = {
|
href={href}
|
||||||
title: "Create Next App",
|
className={`text-sm font-medium transition-colors ${
|
||||||
description: "Generated by create next app",
|
isActive ? "text-white" : "text-neutral-400 hover:text-neutral-200"
|
||||||
};
|
}`}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
children,
|
children,
|
||||||
@@ -23,11 +32,19 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html
|
<html lang="en" className={`dark ${inter.variable} h-full antialiased`}>
|
||||||
lang="en"
|
<body className="min-h-full flex flex-col bg-neutral-950 text-neutral-100">
|
||||||
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
|
<nav className="sticky top-0 z-40 h-14 bg-neutral-900/80 backdrop-blur-md border-b border-neutral-800 px-6 flex items-center justify-between">
|
||||||
>
|
<Link href="/" className="font-bold text-lg text-white">
|
||||||
<body className="min-h-full flex flex-col">{children}</body>
|
Tessera
|
||||||
|
</Link>
|
||||||
|
<div className="flex items-center gap-6">
|
||||||
|
<NavLink href="/">Tickets</NavLink>
|
||||||
|
<NavLink href="/admin">Admin</NavLink>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<main className="container mx-auto px-6 py-8 flex-1">{children}</main>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user