Merged develop into fix/loosen-up-phone-and-address-validation

This commit is contained in:
Chuma Mcphoy (We Ahead)
2024-06-24 14:56:42 +00:00
4 changed files with 17 additions and 15 deletions

View File

@@ -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,
})
}

View File

@@ -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 = {

View File

@@ -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",

View File

@@ -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*`,