feat(BOOK-414): Added hotel branding themes to hotelpages

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-10-02 12:34:38 +00:00
parent f3dc818c06
commit 7fcd5833bd
17 changed files with 217 additions and 83 deletions

View File

@@ -34,6 +34,7 @@ import { FontPreload } from "@/fonts/font-preloading"
import { getMessages } from "@/i18n"
import ClientIntlProvider from "@/i18n/Provider"
import { setLang } from "@/i18n/serverContext"
import { getThemeClass } from "@/utils/theme"
import type { LangParams, LayoutArgs } from "@/types/params"
@@ -41,15 +42,17 @@ export default async function RootLayout(
props: React.PropsWithChildren<
LayoutArgs<LangParams> & {
bookingwidget: React.ReactNode
theme: React.ReactNode
}
>
) {
const params = await props.params
const { bookingwidget, children } = props
const { bookingwidget, theme, children } = props
setLang(params.lang)
const messages = await getMessages(params.lang)
const themeClass = await getThemeClass(params.lang)
return (
<html lang={params.lang}>
@@ -64,7 +67,7 @@ export default async function RootLayout(
window.dataLayer = window.dataLayer || []
`}</Script>
</head>
<body className="scandic">
<body className={themeClass}>
<div className="root">
<SessionProvider basePath="/api/web/auth">
<ClientIntlProvider
@@ -72,6 +75,7 @@ export default async function RootLayout(
locale={params.lang}
messages={messages}
>
{theme}
<NuqsAdapter>
<TrpcProvider>
<RACRouterProvider>