feat(SW-217): Split up Card to two (Card and TeaserCard)

This commit is contained in:
Pontus Dreij
2024-09-26 11:07:03 +02:00
parent 6a85cfd19c
commit bb93bdf69c
11 changed files with 200 additions and 59 deletions

View File

@@ -1,10 +1,11 @@
import SectionContainer from "@/components/Section/Container"
import SectionHeader from "@/components/Section/Header"
import Card from "@/components/TempDesignSystem/Card"
import ContentCard from "@/components/TempDesignSystem/ContentCard"
import Grids from "@/components/TempDesignSystem/Grids"
import LoyaltyCard from "@/components/TempDesignSystem/LoyaltyCard"
import TeaserCard from "../TempDesignSystem/TeaserCard"
import type { CardsGridProps } from "@/types/components/blocks/cardsGrid"
import { CardsGridEnum } from "@/types/enums/cardsGrid"
@@ -22,37 +23,38 @@ export default function CardsGrid({
<Grids.Stackable>
{cards_grid.cards.map((card) => {
switch (card.__typename) {
case CardsGridEnum.cards.Card: {
return card.isContentCard ? (
<ContentCard
case CardsGridEnum.cards.Card:
return (
<Card
theme={cards_grid.theme ?? "one"}
key={card.system.uid}
scriptedTopTitle={card.scripted_top_title}
heading={card.heading}
bodyText={card.body_text}
secondaryButton={card.secondaryButton}
primaryButton={card.primaryButton}
/>
)
case CardsGridEnum.cards.TeaserCard:
return (
<TeaserCard
key={card.system.uid}
title={card.heading}
description={card.body_text}
backgroundImage={card.backgroundImage}
primaryButton={card.primaryButton}
secondaryButton={card.secondaryButton}
sidePeekButton={card.sidePeekButton}
image={card.image}
style="default"
title={card.heading}
/>
) : (
<Card
key={card.system.uid}
bodyText={card.body_text}
heading={card.heading}
primaryButton={card.primaryButton}
secondaryButton={card.secondaryButton}
scriptedTopTitle={card.scripted_top_title}
theme={cards_grid.theme || "one"}
/>
)
}
case CardsGridEnum.cards.LoyaltyCard:
return (
<LoyaltyCard
key={card.system.uid}
bodyText={card.body_text}
heading={card.heading}
image={card.image}
heading={card.heading}
bodyText={card.body_text}
link={card.link}
/>
)