Merged in feature/refactor-lang (pull request #387)
feat: SW-238 Avoid prop drilling of lang Approved-by: Michael Zetterberg
This commit is contained in:
@@ -4,6 +4,7 @@ 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"
|
||||
|
||||
@@ -20,8 +21,10 @@ export default function RootLayout({
|
||||
children,
|
||||
params,
|
||||
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
|
||||
setLang(params.lang)
|
||||
|
||||
return (
|
||||
<html lang={params.lang}>
|
||||
<html lang={getLang()}>
|
||||
<head>
|
||||
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
||||
<link rel="stylesheet" href="/_static/css/core.css" />
|
||||
@@ -30,10 +33,10 @@ export default function RootLayout({
|
||||
</head>
|
||||
<body>
|
||||
<InitLivePreview />
|
||||
<LangPopup lang={params.lang} />
|
||||
<LangPopup />
|
||||
<SkipToMainContent />
|
||||
{children}
|
||||
<Footer lang={params.lang} />
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user