Files
web/app/[lang]/(preview-current)/layout.tsx
Niclas Edenvin e67212bd94 Merged in feature/refactor-lang (pull request #387)
feat: SW-238 Avoid prop drilling of lang

Approved-by: Michael Zetterberg
2024-08-14 11:00:20 +00:00

44 lines
1.2 KiB
TypeScript

import Script from "next/script"
import Footer from "@/components/Current/Footer"
import LangPopup from "@/components/Current/LangPopup"
import InitLivePreview from "@/components/Current/LivePreview"
import SkipToMainContent from "@/components/SkipToMainContent"
import { getLang, setLang } from "@/i18n/serverContext"
import type { Metadata } from "next"
import type { LangParams, LayoutArgs } from "@/types/params"
export const fetchCache = "default-no-store"
export const metadata: Metadata = {
description: "New web",
title: "Scandic Hotels",
}
export default function RootLayout({
children,
params,
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
setLang(params.lang)
return (
<html lang={getLang()}>
<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>
<InitLivePreview />
<LangPopup />
<SkipToMainContent />
{children}
<Footer />
</body>
</html>
)
}