diff --git a/apps/dashboard/src/app/layout.tsx b/apps/dashboard/src/app/layout.tsx index e1917e5..b61f6e4 100644 --- a/apps/dashboard/src/app/layout.tsx +++ b/apps/dashboard/src/app/layout.tsx @@ -1,10 +1,11 @@ import type { Metadata } from 'next' import { cookies } from 'next/headers' import { JetBrains_Mono } from 'next/font/google' +import Script from 'next/script' import '@fontsource-variable/inter/index.css' import '@fontsource-variable/noto-sans-arabic/index.css' import { DashboardI18nProvider } from '@/components/I18nProvider' -import { SHARED_LANGUAGE_COOKIE } from '@/lib/preferences' +import { HOMEPAGE_THEME_COOKIE, SHARED_LANGUAGE_COOKIE, SHARED_THEME_KEY } from '@/lib/preferences' import './globals.css' const jetbrainsMono = JetBrains_Mono({ @@ -33,14 +34,18 @@ export default async function RootLayout({ children }: { children: React.ReactNo cookieStore.get(SHARED_LANGUAGE_COOKIE)?.value ?? cookieStore.get('dashboard-language')?.value, ) const dir = initialLanguage === 'ar' ? 'rtl' : 'ltr' + const cookieTheme = cookieStore.get(SHARED_THEME_KEY)?.value ?? cookieStore.get(HOMEPAGE_THEME_COOKIE)?.value + const initialTheme = cookieTheme === 'light' ? 'light' : 'dark' return ( - + -