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 Content from "@/components/MyPages/AccountPage/Content"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import TrackingSDK from "@/components/TrackingSDK"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
|
||||
@@ -12,6 +13,8 @@ import type { LangParams, PageArgs } from "@/types/params"
|
||||
export default async function MyPages({
|
||||
params,
|
||||
}: PageArgs<LangParams & { path: string[] }>) {
|
||||
setLang(params.lang)
|
||||
|
||||
const accountPageRes = await serverClient().contentstack.accountPage.get()
|
||||
const { formatMessage } = await getIntl()
|
||||
|
||||
@@ -26,7 +29,7 @@ export default async function MyPages({
|
||||
<main className={styles.blocks}>
|
||||
<Title>{accountPage.heading}</Title>
|
||||
{accountPage.content.length ? (
|
||||
<Content lang={params.lang} content={accountPage.content} />
|
||||
<Content content={accountPage.content} />
|
||||
) : (
|
||||
<p>{formatMessage({ id: "No content published" })}</p>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user