fix: links issues, translations and layouts

This commit is contained in:
Christel Westerberg
2024-07-05 14:25:35 +02:00
parent 1e3bbed6d1
commit e49065124b
4 changed files with 22 additions and 9 deletions

View File

@@ -3,6 +3,9 @@ import "@scandic-hotels/design-system/style.css"
import TrpcProvider from "@/lib/trpc/Provider"
import { getIntl } from "@/i18n"
import ServerIntlProvider from "@/i18n/Provider"
import styles from "./layout.module.css"
import type { Metadata } from "next"
@@ -13,14 +16,17 @@ export const metadata: Metadata = {
title: "Webview",
}
export default function RootLayout({
export default async function RootLayout({
children,
params,
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
const { defaultLocale, locale, messages } = await getIntl()
return (
<html lang={params.lang}>
<body className={styles.layout}>
<TrpcProvider lang={params.lang}>{children}</TrpcProvider>
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
<TrpcProvider lang={params.lang}>{children}</TrpcProvider>
</ServerIntlProvider>
</body>
</html>
)