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:
@@ -7,6 +7,7 @@ import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
import PreviousStays from "@/components/MyPages/Blocks/Stays/Previous"
|
||||
import SoonestStays from "@/components/MyPages/Blocks/Stays/Soonest"
|
||||
import UpcomingStays from "@/components/MyPages/Blocks/Stays/Upcoming"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
import { removeMultipleSlashes } from "@/utils/url"
|
||||
|
||||
import PointsOverview from "../Blocks/Points/Overview"
|
||||
@@ -47,7 +48,7 @@ function DynamicComponent({ component, props }: AccountPageContentProps) {
|
||||
}
|
||||
}
|
||||
|
||||
export default function Content({ lang, content }: ContentProps) {
|
||||
export default function Content({ content }: ContentProps) {
|
||||
return content.map((item, idx) => {
|
||||
switch (item.__typename) {
|
||||
case ContentEntries.AccountPageContentDynamicContent:
|
||||
@@ -57,14 +58,13 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
item.dynamic_content.link.linkConnection.edges[0].node
|
||||
.original_url ||
|
||||
removeMultipleSlashes(
|
||||
`/${lang}/${item.dynamic_content.link.linkConnection.edges[0].node.url}`
|
||||
`/${getLang()}/${item.dynamic_content.link.linkConnection.edges[0].node.url}`
|
||||
),
|
||||
text: item.dynamic_content.link.link_text,
|
||||
}
|
||||
: null
|
||||
|
||||
const componentProps = {
|
||||
lang,
|
||||
title: item.dynamic_content.title,
|
||||
// TODO: rename preamble to subtitle in Contentstack?
|
||||
subtitle: item.dynamic_content.preamble,
|
||||
|
||||
Reference in New Issue
Block a user