feat(SW-219): add support for content card in cards grid in content pages
This commit is contained in:
@@ -68,6 +68,7 @@ export const contentPageDynamicContent = z.object({
|
||||
|
||||
export const cardBlock = z.object({
|
||||
__typename: z.literal(CardsGridEnum.Card),
|
||||
isContentCard: z.boolean(),
|
||||
heading: z.string().nullable(),
|
||||
body_text: z.string().nullable(),
|
||||
background_image: z.any(),
|
||||
@@ -88,6 +89,11 @@ export const cardBlock = z.object({
|
||||
isExternal: z.boolean(),
|
||||
})
|
||||
.optional(),
|
||||
sidePeekButton: z
|
||||
.object({
|
||||
title: z.string(),
|
||||
})
|
||||
.optional(),
|
||||
system: z.object({
|
||||
locale: z.nativeEnum(Lang),
|
||||
uid: z.string(),
|
||||
|
||||
@@ -102,6 +102,7 @@ export const contentPageQueryRouter = router({
|
||||
case CardsGridEnum.Card:
|
||||
return {
|
||||
...card,
|
||||
isContentCard: !!card.is_content_card,
|
||||
backgroundImage: makeImageVaultImage(
|
||||
card.background_image
|
||||
),
|
||||
@@ -111,6 +112,14 @@ export const contentPageQueryRouter = router({
|
||||
secondaryButton: card.has_secondary_button
|
||||
? makeButtonObject(card.secondary_button)
|
||||
: undefined,
|
||||
sidePeekButton:
|
||||
card.has_sidepeek_button ||
|
||||
!!card.sidepeek_button?.call_to_action_text
|
||||
? {
|
||||
title:
|
||||
card.sidepeek_button.call_to_action_text,
|
||||
}
|
||||
: undefined,
|
||||
}
|
||||
case CardsGridEnum.LoyaltyCard:
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user