feat(SW-3197): Add required middleware and url to path in partner-sas * Add url to path and required middleware Approved-by: Matilda Landström
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import "@scandic-hotels/design-system/style.css"
|
|
import "@scandic-hotels/design-system/fonts.css"
|
|
import "@/public/_static/css/design-system-new-deprecated.css"
|
|
|
|
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 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 { children } = props
|
|
|
|
setLang(params.lang)
|
|
const messages = await getMessages(params.lang)
|
|
|
|
return (
|
|
<html lang="en">
|
|
<head>
|
|
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
|
<link rel="stylesheet" href="/_static/css/core.css" />
|
|
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
|
<link rel="stylesheet" href="/_static/css/scandic.css" />
|
|
</head>
|
|
<body className="scandic">
|
|
<ClientIntlProvider
|
|
defaultLocale={Lang.en}
|
|
locale={params.lang}
|
|
messages={messages}
|
|
>
|
|
{/* TODO handle onError */}
|
|
<TrpcProvider>{children}</TrpcProvider>
|
|
</ClientIntlProvider>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|