Merged in fix/header-parallel-route (pull request #238)
Static pages sync Approved-by: Michael Zetterberg
This commit is contained in:
@@ -37,7 +37,10 @@ export default function BenefitCard({
|
||||
</div>
|
||||
<div className={styles.benefitComparison}>
|
||||
{comparedValues.map((benefit, idx) => (
|
||||
<div key={idx} className={styles.comparisonItem}>
|
||||
<div
|
||||
key={`${benefit.valueDetails}-${idx}`}
|
||||
className={styles.comparisonItem}
|
||||
>
|
||||
<BenefitValue benefit={benefit} />
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -29,8 +29,9 @@ export default function BenefitList({ levels }: BenefitListProps) {
|
||||
<BenefitCard
|
||||
title={benefit.name}
|
||||
description={benefit.description}
|
||||
comparedValues={levelBenefits.map((benefit) => {
|
||||
comparedValues={levelBenefits.map((benefit, idx) => {
|
||||
return {
|
||||
key: `${benefit.name}-${idx}`,
|
||||
value: benefit.value,
|
||||
unlocked: benefit.unlocked,
|
||||
valueDetails: benefit.valueDetails,
|
||||
|
||||
@@ -14,10 +14,15 @@ export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
|
||||
const firstItem = idx === 0
|
||||
switch (block.__typename) {
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid:
|
||||
return <CardsGrid cards_grid={block.cards_grid} />
|
||||
return (
|
||||
<CardsGrid
|
||||
key={`${block.cards_grid.title}-${idx}`}
|
||||
cards_grid={block.cards_grid}
|
||||
/>
|
||||
)
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent:
|
||||
return (
|
||||
<section>
|
||||
<section key={`${block.__typename}-${idx}`}>
|
||||
<JsonToHtml
|
||||
nodes={block.content.content.json.children}
|
||||
embeds={block.content.content.embedded_itemsConnection.edges}
|
||||
@@ -39,6 +44,7 @@ export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
|
||||
<DynamicContentBlock
|
||||
dynamicContent={dynamicContent}
|
||||
firstItem={firstItem}
|
||||
key={`${block.dynamic_content.title}-${idx}`}
|
||||
/>
|
||||
)
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksShortcuts:
|
||||
@@ -49,6 +55,7 @@ export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
|
||||
return (
|
||||
<Shortcuts
|
||||
firstItem={firstItem}
|
||||
key={`${block.shortcuts.title}-${idx}`}
|
||||
shortcuts={shortcuts}
|
||||
title={block.shortcuts.title}
|
||||
subtitle={block.shortcuts.preamble}
|
||||
|
||||
@@ -13,7 +13,7 @@ export function Blocks({ blocks }: BlocksProps) {
|
||||
switch (block.__typename) {
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent:
|
||||
return (
|
||||
<section>
|
||||
<section key={`${block.__typename}-${idx}`}>
|
||||
<JsonToHtml
|
||||
nodes={block.content.content.json.children}
|
||||
embeds={block.content.content.embedded_itemsConnection.edges}
|
||||
@@ -25,19 +25,26 @@ export function Blocks({ blocks }: BlocksProps) {
|
||||
<DynamicContentBlock
|
||||
dynamicContent={block.dynamic_content}
|
||||
firstItem={firstItem}
|
||||
key={`${block.dynamic_content.title}-${idx}`}
|
||||
/>
|
||||
)
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksShortcuts:
|
||||
return (
|
||||
<Shortcuts
|
||||
firstItem={firstItem}
|
||||
key={`${block.shortcuts.title}-${idx}`}
|
||||
shortcuts={block.shortcuts.shortcuts}
|
||||
subtitle={block.shortcuts.preamble}
|
||||
title={block.shortcuts.title}
|
||||
/>
|
||||
)
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid:
|
||||
return <CardsGrid cards_grid={block.cards_grid} />
|
||||
return (
|
||||
<CardsGrid
|
||||
cards_grid={block.cards_grid}
|
||||
key={`${block.cards_grid.title}-${idx}`}
|
||||
/>
|
||||
)
|
||||
default:
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -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" })}
|
||||
|
||||
@@ -6,15 +6,22 @@ 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}>
|
||||
{blocks.map((block) => {
|
||||
{blocks.map((block, idx) => {
|
||||
switch (block.__typename) {
|
||||
case SidebarTypenameEnum.LoyaltyPageSidebarContent:
|
||||
return (
|
||||
<section className={styles.content}>
|
||||
<section
|
||||
className={styles.content}
|
||||
key={`${block.__typename}-${idx}`}
|
||||
>
|
||||
<JsonToHtml
|
||||
embeds={block.content.content.embedded_itemsConnection.edges}
|
||||
nodes={block.content.content.json.children}
|
||||
@@ -26,6 +33,7 @@ export default function SidebarLoyalty({ blocks, lang }: SidebarProps) {
|
||||
<JoinLoyaltyContact
|
||||
block={block.join_loyalty_contact}
|
||||
lang={lang}
|
||||
key={`${block.join_loyalty_contact.title}-${idx}`}
|
||||
/>
|
||||
)
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user