diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx index a2e2bbe25..f9295f745 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx @@ -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() - 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, }) } diff --git a/constants/routes/webviews.ts b/constants/routes/webviews.ts index 2680e6228..66a0b999f 100644 --- a/constants/routes/webviews.ts +++ b/constants/routes/webviews.ts @@ -35,12 +35,12 @@ export const points = { } export const programOverview = { - da: `/da/webview/about-scandic-friends`, - de: `/de/webview/about-scandic-friends`, - en: `/en/webview/about-scandic-friends`, - fi: `/fi/webview/about-scandic-friends`, - no: `/no/webview/om-scandic-friends`, - sv: `/sv/webview/om-scandic-friends`, + da: `/da/webview/scandic-friends`, + de: `/de/webview/scandic-friends`, + en: `/en/webview/scandic-friends`, + fi: `/fi/webview/scandic-friends`, + no: `/no/webview/scandic-friends`, + sv: `/sv/webview/scandic-friends`, } const refreshUrl = { diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index 42b4fd967..e0cfd7b2b 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -39,7 +39,7 @@ "Level": "Level", "Level up to unlock": "Level up to unlock", "Log in": "Log in", - "Log out": "Sign out", + "Log out": "Log out", "Membership cards": "Membership cards", "Membership ID": "Membership ID", "Month": "Month", diff --git a/next.config.js b/next.config.js index d2de733c9..ac5c68cea 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,6 @@ import createJiti from "jiti" -import { login } from "./constants/routes/handleAuth.js" +import { login, logout } from "./constants/routes/handleAuth.js" import { myPages } from "./constants/routes/myPages.js" const jiti = createJiti(new URL(import.meta.url).pathname) @@ -70,6 +70,11 @@ const nextConfig = { { source: login.fi, destination: "/fi/login" }, { source: login.no, destination: "/no/login" }, { source: login.sv, destination: "/sv/login" }, + { source: logout.da, destination: "/da/logout" }, + { source: logout.de, destination: "/de/logout" }, + { source: logout.fi, destination: "/fi/logout" }, + { source: logout.no, destination: "/no/logout" }, + { source: logout.sv, destination: "/sv/logout" }, { source: `${myPages.en}/:path*`, destination: `/en/my-pages/:path*`,