fix: point to english for all content in compare overview
This commit is contained in:
@@ -30,10 +30,8 @@ import {
|
||||
OverviewTableProps,
|
||||
OverviewTableReducerAction,
|
||||
} from "@/types/components/loyalty/blocks"
|
||||
import { LangParams } from "@/types/params"
|
||||
import { User } from "@/types/user"
|
||||
|
||||
|
||||
const levelsTranslations = {
|
||||
[Lang.en]: EN,
|
||||
[Lang.sv]: SV,
|
||||
@@ -42,7 +40,6 @@ const levelsTranslations = {
|
||||
[Lang.fi]: FI,
|
||||
[Lang.de]: DE,
|
||||
}
|
||||
|
||||
function getTranslatedLevelByTier(tier: membershipLevels, lang: Lang) {
|
||||
return levelsTranslations[lang].levels.find(
|
||||
(level) => level.tier === tier
|
||||
@@ -125,11 +122,11 @@ function reducer(state: any, action: OverviewTableReducerAction) {
|
||||
|
||||
export default function OverviewTable({ user }: OverviewTableProps) {
|
||||
const intl = useIntl()
|
||||
const params = useParams<LangParams>()
|
||||
const levelsData = levelsTranslations[params.lang]
|
||||
const lang = Lang.en
|
||||
const levelsData = levelsTranslations[lang]
|
||||
const [selectionState, dispatch] = useReducer(
|
||||
reducer,
|
||||
{ user, lang: params.lang },
|
||||
{ user, lang },
|
||||
getInitialState
|
||||
)
|
||||
|
||||
@@ -137,7 +134,7 @@ export default function OverviewTable({ user }: OverviewTableProps) {
|
||||
return (key: Key) => {
|
||||
if (typeof key === "number") {
|
||||
dispatch({
|
||||
payload: getTranslatedLevelByTier(key, params.lang),
|
||||
payload: getTranslatedLevelByTier(key, lang),
|
||||
type: actionType,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user