Study/src/app/layout.tsx
Elijah bd071b3906
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m6s
New: Ui Redesign (#1)
Reviewed-on: #1
2026-07-11 13:50:31 -07:00

48 lines
1.4 KiB
TypeScript

import type { Metadata } from "next";
import { Manrope, Newsreader } from "next/font/google";
import Script from "next/script";
import "./globals.css";
const manrope = Manrope({
variable: "--font-manrope",
subsets: ["latin"],
display: "swap",
});
const newsreader = Newsreader({
variable: "--font-newsreader",
subsets: ["latin"],
display: "swap",
});
export const metadata: Metadata = {
title: "Study Desk",
description: "A focused workspace for flashcards and practice quizzes",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" className={`${manrope.variable} ${newsreader.variable} h-full`} suppressHydrationWarning>
<body className="min-h-full flex flex-col font-sans antialiased">
<Script id="theme-init" strategy="beforeInteractive">
{`
try {
const savedTheme = localStorage.theme
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
if (savedTheme === 'dark' || (!savedTheme && prefersDark)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
} catch (_) {}
`}
</Script>
{children}
</body>
</html>
);
}