diff options
Diffstat (limited to 'app/layout.tsx')
| -rw-r--r-- | app/layout.tsx | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/app/layout.tsx b/app/layout.tsx index 4923aa22..256e0edc 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,9 +1,8 @@ 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 { ThemeProvider } from "@/components/layout/providers"; // 기존 ThemeProvider 사용 import { cn } from "@/lib/utils" import { META_THEME_COLORS, siteConfig } from "@/config/site" import { LicenseInfo } from '@mui/x-license'; @@ -59,47 +58,47 @@ export default async function RootLayout({ 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> - + <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-slate-100 font-sans antialiased", - inter.className, - )} + className={cn( + "min-h-svh bg-slate-100 font-sans antialiased", + inter.className, + )} + > + {/* ✅ 기존 ThemeProvider에 lng prop 전달 */} + <ThemeProvider + attribute="class" + defaultTheme="system" + enableSystem + disableTransitionOnChange + enableColorScheme + lng={lng} // ✅ lng 전달 > - <ThemeProvider - attribute="class" - defaultTheme="system" - enableSystem - disableTransitionOnChange - enableColorScheme - > - <div vaul-drawer-wrapper=""> - {/* <div className="relative flex min-h-svh flex-col bg-slate-100"> */} - <div className="relative flex min-h-svh flex-col bg-background"> - {children} - </div> + <div vaul-drawer-wrapper=""> + <div className="relative flex min-h-svh flex-col bg-background"> + {children} </div> - <Toaster /> - <ToasterSonner/> - </ThemeProvider> - </body> + </div> + + {/* Toast Notifications */} + <Toaster /> + <ToasterSonner /> + </ThemeProvider> + </body> </html> ); }
\ No newline at end of file |
