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>
{cards_grid.cards.map((card) => {
switch (card.__typename) {
case CardsGridEnum.Card: {
if (card.isContentCard) {
return (
<ContentCard
key={card.system.uid}
title={card.heading || ""}
description={card.body_text || ""}
primaryButton={card.primaryButton}
secondaryButton={card.secondaryButton}
sidePeekButton={card.sidePeekButton}
backgroundImage={card.background_image}
style="default"
/>
)
} else {
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.Card:
return card.isContentCard ? (
<ContentCard
key={card.system.uid}
title={card.heading || ""}
description={card.body_text || ""}
primaryButton={card.primaryButton}
secondaryButton={card.secondaryButton}
sidePeekButton={card.sidePeekButton}
backgroundImage={card.background_image}
style="default"
/>
) : (
<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.LoyaltyCard:
return (
<LoyaltyCard

View File

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