Merged in SW-1382-start-page-offers-section (pull request #1221)

SW-1382 start page offers section

* feat(SW-1382): Add InfoCard component to CardsGrid and StartPage

* feat(SW-1382): Add dynamic image positioning for InfoCard in CardsGrid

* refactor(SW-1382): Update InfoCard data transformation and prop naming

* fix(SW-1382): Add flex display to InfoCard image container


Approved-by: Christian Andolf
Approved-by: Erik Tiekstra
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-01-29 10:21:33 +00:00
parent ca42876eb8
commit b57174647f
17 changed files with 405 additions and 9 deletions

View File

@@ -2,12 +2,14 @@ import type { Block as AccountPageBlock } from "@/types/trpc/routers/contentstac
import type { Block as CollectionPageBlock } from "@/types/trpc/routers/contentstack/collectionPage"
import type { Block as ContentPageBlock } from "@/types/trpc/routers/contentstack/contentPage"
import type { Block as LoyaltyPageBlock } from "@/types/trpc/routers/contentstack/loyaltyPage"
import type { Block as StartPageBlock } from "@/types/trpc/routers/contentstack/startPage"
export type Blocks =
| AccountPageBlock
| CollectionPageBlock
| ContentPageBlock
| LoyaltyPageBlock
| StartPageBlock
export interface BlocksProps {
blocks: Blocks[]

View File

@@ -0,0 +1,22 @@
import type { VariantProps } from "class-variance-authority"
import type { ImageVaultAsset } from "@/types/components/imageVault"
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
import type { cardVariants } from "@/components/TempDesignSystem/Card/variants"
type CardTheme = Exclude<
NonNullable<VariantProps<typeof cardVariants>["theme"]>,
"image"
>
export interface InfoCardProps {
scriptedTopTitle?: string
heading: string
bodyText: string
image?: ImageVaultAsset
imagePosition?: "left" | "right"
primaryButton?: CardProps["primaryButton"]
secondaryButton?: CardProps["secondaryButton"]
theme?: CardTheme
className?: string
}

View File

@@ -3,6 +3,7 @@ export namespace CardsGridEnum {
Card = "Card",
LoyaltyCard = "LoyaltyCard",
TeaserCard = "TeaserCard",
InfoCard = "InfoCard",
}
}

7
types/enums/startPage.ts Normal file
View File

@@ -0,0 +1,7 @@
export namespace StartPageEnum {
export namespace ContentStack {
export const enum blocks {
CardsGrid = "StartPageBlocksCardsGrid",
}
}
}

View File

@@ -1,6 +1,7 @@
import type { z } from "zod"
import type {
blocksSchema,
startPageRefsSchema,
startPageSchema,
} from "@/server/routers/contentstack/startPage/output"
@@ -12,3 +13,5 @@ export interface GetStartPageRefsSchema
extends z.input<typeof startPageRefsSchema> {}
export interface StartPageRefs extends z.output<typeof startPageRefsSchema> {}
export type Block = z.output<typeof blocksSchema>