80 lines
2.2 KiB
TypeScript
80 lines
2.2 KiB
TypeScript
import "@scandic-hotels/design-system/fonts.css"
|
|
import "@scandic-hotels/design-system/style.css"
|
|
import "@/public/_static/css/design-system-new-deprecated.css"
|
|
import "../../globals.css"
|
|
|
|
import { BookingFlowTrackingProvider } from "@scandic-hotels/booking-flow/BookingFlowTrackingProvider"
|
|
import { Lang } from "@scandic-hotels/common/constants/language"
|
|
import { TrpcProvider } from "@scandic-hotels/trpc/Provider"
|
|
|
|
import { getMessages } from "@/i18n"
|
|
import ClientIntlProvider from "@/i18n/Provider"
|
|
import { setLang } from "@/i18n/serverContext"
|
|
|
|
import { trackBookingSearchClick } from "../utils/tracking"
|
|
|
|
import type { Metadata } from "next"
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Create Next App",
|
|
description: "Generated by create next app",
|
|
}
|
|
|
|
type LangParams = {
|
|
lang: Lang
|
|
}
|
|
|
|
type RootLayoutProps = {
|
|
children: React.ReactNode
|
|
params: Promise<LangParams>
|
|
}
|
|
|
|
export default async function RootLayout(props: RootLayoutProps) {
|
|
// const params = await props.params
|
|
const lang = Lang.en //params.lang
|
|
|
|
const { children } = props
|
|
|
|
setLang(lang)
|
|
const messages = await getMessages(lang)
|
|
|
|
return (
|
|
<html lang="en">
|
|
<head>{/* TODO */}</head>
|
|
<body className="scandic">
|
|
<div className="root">
|
|
<ClientIntlProvider
|
|
defaultLocale={Lang.en}
|
|
locale={lang}
|
|
messages={messages}
|
|
>
|
|
{/* TODO handle onError */}
|
|
<TrpcProvider>
|
|
<BookingFlowTrackingProvider
|
|
trackingFunctions={{
|
|
trackBookingSearchClick,
|
|
}}
|
|
>
|
|
<header
|
|
style={{
|
|
height: 64,
|
|
backgroundColor: "dodgerblue",
|
|
color: "white",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
}}
|
|
>
|
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
|
<h1>SAS</h1>
|
|
</header>
|
|
<main>{children}</main>
|
|
</BookingFlowTrackingProvider>
|
|
</TrpcProvider>
|
|
</ClientIntlProvider>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|