fix frontend

This commit is contained in:
root
2026-05-25 00:47:22 -04:00
parent 9bd0938951
commit 5ef9efb8a9
9 changed files with 95 additions and 73 deletions
+8 -1
View File
@@ -1,4 +1,5 @@
import type { Metadata } from 'next'
import { cookies } from 'next/headers'
import MarketplaceShell from '@/components/MarketplaceShell'
import { getMarketplaceLanguage } from '@/lib/i18n.server'
import './globals.css'
@@ -15,6 +16,12 @@ export const metadata: Metadata = {
export default function RootLayout({ children }: { children: React.ReactNode }) {
const language = getMarketplaceLanguage()
const cookieStore = cookies()
const rawTheme =
cookieStore.get('rentaldrivego-theme')?.value ??
cookieStore.get('marketplace-theme')?.value
const theme = rawTheme === 'dark' ? 'dark' : 'light'
return (
<html lang={language} dir={language === 'ar' ? 'rtl' : 'ltr'} suppressHydrationWarning>
<head>
@@ -27,7 +34,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
/>
</head>
<body suppressHydrationWarning>
<MarketplaceShell initialLanguage={language}>{children}</MarketplaceShell>
<MarketplaceShell initialLanguage={language} initialTheme={theme}>{children}</MarketplaceShell>
</body>
</html>
)