fix(SW-219): review comments

This commit is contained in:
Chuma McPhoy
2024-09-16 08:53:44 +02:00
parent 68437356f0
commit 3151572108
2 changed files with 25 additions and 30 deletions

View File

@@ -22,34 +22,29 @@ export default function CardsGrid({
<Grids.Stackable> <Grids.Stackable>
{cards_grid.cards.map((card) => { {cards_grid.cards.map((card) => {
switch (card.__typename) { switch (card.__typename) {
case CardsGridEnum.Card: { case CardsGridEnum.Card:
if (card.isContentCard) { return card.isContentCard ? (
return ( <ContentCard
<ContentCard key={card.system.uid}
key={card.system.uid} title={card.heading || ""}
title={card.heading || ""} description={card.body_text || ""}
description={card.body_text || ""} primaryButton={card.primaryButton}
primaryButton={card.primaryButton} secondaryButton={card.secondaryButton}
secondaryButton={card.secondaryButton} sidePeekButton={card.sidePeekButton}
sidePeekButton={card.sidePeekButton} backgroundImage={card.background_image}
backgroundImage={card.background_image} style="default"
style="default" />
/> ) : (
) <Card
} else { theme={cards_grid.theme || "one"}
return ( key={card.system.uid}
<Card scriptedTopTitle={card.scripted_top_title}
theme={cards_grid.theme || "one"} heading={card.heading}
key={card.system.uid} bodyText={card.body_text}
scriptedTopTitle={card.scripted_top_title} secondaryButton={card.secondaryButton}
heading={card.heading} primaryButton={card.primaryButton}
bodyText={card.body_text} />
secondaryButton={card.secondaryButton} )
primaryButton={card.primaryButton}
/>
)
}
}
case CardsGridEnum.LoyaltyCard: case CardsGridEnum.LoyaltyCard:
return ( return (
<LoyaltyCard <LoyaltyCard

View File

@@ -1,11 +1,11 @@
import { VariantProps } from "class-variance-authority" import { VariantProps } from "class-variance-authority"
import { CardProps } from "@/components/TempDesignSystem/Card/card"
import { contentCardVariants } from "@/components/TempDesignSystem/ContentCard/variants" import { contentCardVariants } from "@/components/TempDesignSystem/ContentCard/variants"
import { ImageVaultAsset } from "@/types/components/imageVault" import { ImageVaultAsset } from "@/types/components/imageVault"
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
export interface SidePeekButton { interface SidePeekButton {
title: string title: string
} }