summaryrefslogtreecommitdiff
path: root/app/layout.tsx
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-03-25 15:55:45 +0900
committerjoonhoekim <26rote@gmail.com>2025-03-25 15:55:45 +0900
commit1a2241c40e10193c5ff7008a7b7b36cc1d855d96 (patch)
tree8a5587f10ca55b162d7e3254cb088b323a34c41b /app/layout.tsx
initial commit
Diffstat (limited to 'app/layout.tsx')
-rw-r--r--app/layout.tsx85
1 files changed, 85 insertions, 0 deletions
diff --git a/app/layout.tsx b/app/layout.tsx
new file mode 100644
index 00000000..7ed768a5
--- /dev/null
+++ b/app/layout.tsx
@@ -0,0 +1,85 @@
+import type { Metadata } from "next";
+import { Inter } from "next/font/google";
+import "./globals.css";
+import { languages } from "@/i18n/settings";
+import { Toaster } from "@/components/ui/toaster"
+import { ThemeProvider } from "@/components/layout/providers";
+import { cn } from "@/lib/utils"
+import { META_THEME_COLORS, siteConfig } from "@/config/site"
+import { LicenseInfo } from '@mui/x-license';
+import { ToasterSonner } from "@/components/ui/toasterSonner";
+
+LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_KEY as string);
+
+const inter = Inter({ subsets: ['latin'] });
+
+export const generateStaticParams = async () => {
+ return languages.map((lng) => ({ lng }));
+};
+
+export const metadata: Metadata = {
+ title: {
+ default: siteConfig.name,
+ template: `%s - ${siteConfig.name}`,
+ },
+ metadataBase: new URL(siteConfig.url),
+ description: siteConfig.description,
+ authors: [
+ {
+ name: "DTS",
+ url: "https://dtsoution.io",
+ },
+ ],
+ creator: "dujin",
+};
+
+export default async function RootLayout({
+ children,
+ params: { lng },
+}: {
+ children: React.ReactNode;
+ params: { lng: string };
+}) {
+
+
+ return (
+ <html lang={lng} suppressHydrationWarning>
+ <head>
+ <script
+ dangerouslySetInnerHTML={{
+ __html: `
+ try {
+ if (localStorage.theme === 'dark' || ((!('theme' in localStorage) || localStorage.theme === 'system') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
+ document.querySelector('meta[name="theme-color"]').setAttribute('content', '${META_THEME_COLORS.dark}')
+ }
+ } catch (_) {}
+ `,
+ }}
+ />
+ </head>
+
+ <body
+ className={cn(
+ "min-h-svh bg-background font-sans antialiased",
+ inter.className,
+ )}
+ >
+ <ThemeProvider
+ attribute="class"
+ defaultTheme="system"
+ enableSystem
+ disableTransitionOnChange
+ enableColorScheme
+ >
+ <div vaul-drawer-wrapper="">
+ <div className="relative flex min-h-svh flex-col bg-background">
+ {children}
+ </div>
+ </div>
+ <Toaster />
+ <ToasterSonner/>
+ </ThemeProvider>
+ </body>
+ </html>
+ );
+} \ No newline at end of file