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:
@@ -1,6 +1,7 @@
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
import Overview from "@/components/MyPages/Blocks/Overview"
|
||||
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
import { removeMultipleSlashes } from "@/utils/url"
|
||||
import { modWebviewLink } from "@/utils/webviews"
|
||||
|
||||
@@ -39,7 +40,7 @@ function DynamicComponent({ component, props }: AccountPageContentProps) {
|
||||
}
|
||||
}
|
||||
|
||||
export default function Content({ lang, content }: ContentProps) {
|
||||
export default function Content({ content }: ContentProps) {
|
||||
return (
|
||||
<>
|
||||
{content.map((item, idx) => {
|
||||
@@ -62,7 +63,6 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
: null
|
||||
|
||||
const componentProps = {
|
||||
lang,
|
||||
title: item.dynamic_content.title,
|
||||
// TODO: rename preamble to subtitle in Contentstack?
|
||||
subtitle: item.dynamic_content.preamble,
|
||||
@@ -79,7 +79,7 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
const shortcuts = item.shortcuts.shortcuts.map((shortcut) => {
|
||||
return {
|
||||
...shortcut,
|
||||
url: modWebviewLink(shortcut.url, lang),
|
||||
url: modWebviewLink(shortcut.url, getLang()),
|
||||
}
|
||||
})
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user