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:
Niclas Edenvin
2024-08-14 11:00:20 +00:00
parent 35128dbf44
commit e67212bd94
94 changed files with 378 additions and 322 deletions

View File

@@ -8,6 +8,7 @@ import { membershipLevels } from "@/constants/membershipLevels"
import Image from "@/components/Image"
import Select from "@/components/TempDesignSystem/Select"
import useLang from "@/hooks/useLang"
import { getMembership } from "@/utils/user"
import DA from "./data/DA.json"
@@ -33,7 +34,6 @@ import {
OverviewTableProps,
OverviewTableReducerAction,
} from "@/types/components/loyalty/blocks"
import { LangParams } from "@/types/params"
import type { User } from "@/types/user"
const levelsTranslations = {
@@ -127,9 +127,9 @@ function reducer(state: any, action: OverviewTableReducerAction) {
export default function OverviewTable({
activeMembership,
lang,
}: OverviewTableProps & LangParams) {
}: OverviewTableProps) {
const intl = useIntl()
const lang = useLang()
const levelsData = levelsTranslations[lang]
const [selectionState, dispatch] = useReducer(
reducer,