|
| 1 | +import "@/styles/globals.css"; |
| 2 | +import { Metadata } from "next"; |
| 3 | +import { siteConfig } from "@/config/site"; |
| 4 | +import { fontSans } from "@/config/fonts"; |
| 5 | +import { Providers } from "./providers"; |
| 6 | +import { Navbar } from "@/components/navbar"; |
| 7 | +import { Link } from "@nextui-org/link"; |
| 8 | +import clsx from "clsx"; |
| 9 | + |
| 10 | +export const metadata: Metadata = { |
| 11 | + title: { |
| 12 | + default: siteConfig.name, |
| 13 | + template: `%s - ${siteConfig.name}`, |
| 14 | + }, |
| 15 | + description: siteConfig.description, |
| 16 | + themeColor: [ |
| 17 | + { media: "(prefers-color-scheme: light)", color: "white" }, |
| 18 | + { media: "(prefers-color-scheme: dark)", color: "black" }, |
| 19 | + ], |
| 20 | + icons: { |
| 21 | + icon: "/favicon.ico", |
| 22 | + shortcut: "/favicon-16x16.png", |
| 23 | + apple: "/apple-touch-icon.png", |
| 24 | + }, |
| 25 | +}; |
| 26 | + |
| 27 | +export default function RootLayout({ |
| 28 | + children, |
| 29 | +}: { |
| 30 | + children: React.ReactNode; |
| 31 | +}) { |
| 32 | + return ( |
| 33 | + <html lang="en" suppressHydrationWarning> |
| 34 | + <head /> |
| 35 | + <body |
| 36 | + className={clsx( |
| 37 | + "min-h-screen bg-background font-sans antialiased", |
| 38 | + fontSans.variable |
| 39 | + )} |
| 40 | + > |
| 41 | + <Providers themeProps={{ attribute: "class", defaultTheme: "dark" }}> |
| 42 | + <div className="relative flex flex-col h-screen"> |
| 43 | + <Navbar /> |
| 44 | + <main className="container mx-auto max-w-7xl pt-16 px-6 flex-grow"> |
| 45 | + {children} |
| 46 | + </main> |
| 47 | + <footer className="w-full flex items-center justify-center py-3"> |
| 48 | + <Link |
| 49 | + isExternal |
| 50 | + className="flex items-center gap-1 text-current" |
| 51 | + href="https://nextui-docs-v2.vercel.app?utm_source=next-app-template" |
| 52 | + title="nextui.org homepage" |
| 53 | + > |
| 54 | + <span className="text-default-600">Powered by</span> |
| 55 | + <p className="text-primary">NextUI</p> |
| 56 | + </Link> |
| 57 | + </footer> |
| 58 | + </div> |
| 59 | + </Providers> |
| 60 | + </body> |
| 61 | + </html> |
| 62 | + ); |
| 63 | +} |
0 commit comments