fix: error page for language switcher

This commit is contained in:
Christel Westerberg
2024-06-10 11:32:32 +02:00
parent b8982dacf4
commit d8f25925df
9 changed files with 57 additions and 37 deletions

View File

@@ -1,3 +1,5 @@
import { login } from "@/constants/routes/handleAuth"
import { ScandicFriends } from "@/components/Levels"
import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link"
@@ -11,11 +13,12 @@ import Contact from "./Contact"
import styles from "./joinLoyalty.module.css"
import type { JoinLoyaltyContactProps } from "@/types/components/loyalty/sidebar"
import { LangParams } from "@/types/params"
export default async function JoinLoyaltyContact({
block,
lang,
}: JoinLoyaltyContactProps) {
}: JoinLoyaltyContactProps & LangParams) {
const { formatMessage } = await getIntl()
return (
<section className={styles.container}>
@@ -28,11 +31,9 @@ export default async function JoinLoyaltyContact({
<Body textAlign="center">{block.preamble}</Body>
) : null}
<Button asChild className={styles.link} intent="primary">
<Link href="#">
{formatMessage({ id: "Join Scandic Friends" })}
</Link>
<Link href="#">{formatMessage({ id: "Join Scandic Friends" })}</Link>
</Button>
<Link href={`/${lang}/login`}>
<Link href={login[lang]}>
<Footnote textAlign="center" textTransform="bold">
{formatMessage({ id: "Already a friend?" })} <br />
{formatMessage({ id: "Click here to log in" })}

View File

@@ -6,10 +6,14 @@ import styles from "./sidebar.module.css"
import { SidebarTypenameEnum } from "@/types/components/loyalty/enums"
import { SidebarProps } from "@/types/components/loyalty/sidebar"
import { LangParams } from "@/types/params"
export default function SidebarLoyalty({ blocks, lang }: SidebarProps) {
export default function SidebarLoyalty({
blocks,
lang,
}: SidebarProps & LangParams) {
return (
<aside className={styles.aside}>
<aside className={styles.aside}>
{blocks.map((block, idx) => {
switch (block.__typename) {
case SidebarTypenameEnum.LoyaltyPageSidebarContent: