From 7d982aad18509bb1280e5af6d1e06c91996b20c2 Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Tue, 21 May 2024 13:45:52 +0200 Subject: [PATCH] feat: add new cards grid block --- components/JsonToHtml/renderOptions.tsx | 3 +- .../Blocks/CardGrid/cardGrid.module.css | 28 --- components/Loyalty/Blocks/CardGrid/index.tsx | 41 ---- .../Blocks/CardsGrid/cardsGrid.module.css | 4 + components/Loyalty/Blocks/CardsGrid/index.tsx | 44 ++++ components/Loyalty/Blocks/index.tsx | 6 +- components/TempDesignSystem/Card/variants.ts | 16 ++ .../CardGrid/cardGrid.module.css | 9 +- lib/graphql/Fragments/Blocks/Card.graphql | 49 +++++ .../Fragments/Blocks/Refs/Card.graphql | 29 +++ lib/graphql/Query/LoyaltyPage.graphql | 78 +++---- .../contentstack/loyaltyPage/output.ts | 198 ++++++++++++------ .../routers/contentstack/loyaltyPage/query.ts | 84 ++++++-- .../routers/contentstack/loyaltyPage/utils.ts | 12 +- types/components/loyalty/blocks.ts | 4 +- types/components/loyalty/enums.ts | 2 +- 16 files changed, 402 insertions(+), 205 deletions(-) delete mode 100644 components/Loyalty/Blocks/CardGrid/cardGrid.module.css delete mode 100644 components/Loyalty/Blocks/CardGrid/index.tsx create mode 100644 components/Loyalty/Blocks/CardsGrid/cardsGrid.module.css create mode 100644 components/Loyalty/Blocks/CardsGrid/index.tsx create mode 100644 components/TempDesignSystem/Card/variants.ts create mode 100644 lib/graphql/Fragments/Blocks/Card.graphql create mode 100644 lib/graphql/Fragments/Blocks/Refs/Card.graphql diff --git a/components/JsonToHtml/renderOptions.tsx b/components/JsonToHtml/renderOptions.tsx index b9423cc48..1cfd100f8 100644 --- a/components/JsonToHtml/renderOptions.tsx +++ b/components/JsonToHtml/renderOptions.tsx @@ -17,7 +17,8 @@ import type { import { RTEMarkType } from "@/types/rte/node" import type { RenderOptions } from "@/types/rte/option" -function extractPossibleAttributes(attrs: Attributes) { +function extractPossibleAttributes(attrs: Attributes | undefined) { + if (!attrs) return {} const props: Record = {} if (attrs.id) { props.id = attrs.id diff --git a/components/Loyalty/Blocks/CardGrid/cardGrid.module.css b/components/Loyalty/Blocks/CardGrid/cardGrid.module.css deleted file mode 100644 index 915c86f35..000000000 --- a/components/Loyalty/Blocks/CardGrid/cardGrid.module.css +++ /dev/null @@ -1,28 +0,0 @@ -.container { - display: grid; - gap: 2.4rem; -} - -.subtitle { - margin: 0; -} - -.titleContainer { - display: grid; - gap: 0.8rem; -} - -.cardContainer { - display: grid; - gap: 1.6rem; -} - -@media screen and (min-width: 950px) { - .cardContainer { - grid-template-columns: 1fr 1fr; - } - - .cardWrapper:last-child { - grid-column: span 2; - } -} diff --git a/components/Loyalty/Blocks/CardGrid/index.tsx b/components/Loyalty/Blocks/CardGrid/index.tsx deleted file mode 100644 index cd457f550..000000000 --- a/components/Loyalty/Blocks/CardGrid/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { _ } from "@/lib/translation" - -import Card from "@/components/TempDesignSystem/Card" -import Title from "@/components/Title" - -import styles from "./cardGrid.module.css" - -import { CardGridProps } from "@/types/components/loyalty/blocks" - -export default function CardGrid({ card_grid }: CardGridProps) { - return ( -
-
- - {card_grid.title} - - {card_grid.subtitle ? ( - - {card_grid.subtitle} - - ) : null} -
-
- {card_grid.cards.map((card, i) => ( -
- -
- ))} -
-
- ) -} diff --git a/components/Loyalty/Blocks/CardsGrid/cardsGrid.module.css b/components/Loyalty/Blocks/CardsGrid/cardsGrid.module.css new file mode 100644 index 000000000..cf54d5eb3 --- /dev/null +++ b/components/Loyalty/Blocks/CardsGrid/cardsGrid.module.css @@ -0,0 +1,4 @@ +.section { + display: grid; + gap: 2.4rem; +} diff --git a/components/Loyalty/Blocks/CardsGrid/index.tsx b/components/Loyalty/Blocks/CardsGrid/index.tsx new file mode 100644 index 000000000..a36b559df --- /dev/null +++ b/components/Loyalty/Blocks/CardsGrid/index.tsx @@ -0,0 +1,44 @@ +import { _ } from "@/lib/translation" + +import Header from "@/components/MyPages/Blocks/Header" +import Card from "@/components/TempDesignSystem/Card" +import CardGrid from "@/components/TempDesignSystem/CardGrid" + +import styles from "./cardsGrid.module.css" + +import { CardsGridProps } from "@/types/components/loyalty/blocks" + +export default function CardsGrid({ cards_grid }: CardsGridProps) { + return ( +
+
+ + {cards_grid.cards.map((card) => ( + + ))} + +
+ ) +} diff --git a/components/Loyalty/Blocks/index.tsx b/components/Loyalty/Blocks/index.tsx index 3843d93dd..e9192914b 100644 --- a/components/Loyalty/Blocks/index.tsx +++ b/components/Loyalty/Blocks/index.tsx @@ -2,7 +2,7 @@ import JsonToHtml from "@/components/JsonToHtml" import DynamicContentBlock from "@/components/Loyalty/Blocks/DynamicContent" import Shortcuts from "@/components/MyPages/Blocks/Shortcuts" -import CardGrid from "./CardGrid" +import CardsGrid from "./CardsGrid" import type { BlocksProps } from "@/types/components/loyalty/blocks" import { LoyaltyBlocksTypenameEnum } from "@/types/components/loyalty/enums" @@ -10,8 +10,6 @@ import { LoyaltyBlocksTypenameEnum } from "@/types/components/loyalty/enums" export function Blocks({ blocks }: BlocksProps) { return blocks.map((block) => { switch (block.__typename) { - case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid: - return case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent: return (
@@ -31,6 +29,8 @@ export function Blocks({ blocks }: BlocksProps) { subtitle={block.shortcuts.preamble} /> ) + case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid: + return default: return null } diff --git a/components/TempDesignSystem/Card/variants.ts b/components/TempDesignSystem/Card/variants.ts new file mode 100644 index 000000000..1d660ac17 --- /dev/null +++ b/components/TempDesignSystem/Card/variants.ts @@ -0,0 +1,16 @@ +import { cva } from "class-variance-authority" + +import styles from "./card.module.css" + +export const cardVariants = cva(styles.container, { + variants: { + theme: { + one: styles.themeOne, + two: styles.themeTwo, + three: styles.themeThree, + }, + }, + defaultVariants: { + theme: "one", + }, +}) diff --git a/components/TempDesignSystem/CardGrid/cardGrid.module.css b/components/TempDesignSystem/CardGrid/cardGrid.module.css index 78859c6e6..8ead1f937 100644 --- a/components/TempDesignSystem/CardGrid/cardGrid.module.css +++ b/components/TempDesignSystem/CardGrid/cardGrid.module.css @@ -37,14 +37,19 @@ } @media screen and (min-width: 950px) { - .twoColumnGrid { + .twoColumnGrid, + .twoPlusOne { grid-template-columns: repeat(2, 1fr); } - .treeColumnGrid { + .threeColumnGrid { grid-template-columns: repeat(3, 1fr); } + .twoPlusOne > *:last-child { + grid-column: span 2; + } + .carousel { grid-auto-flow: unset; margin: 0; diff --git a/lib/graphql/Fragments/Blocks/Card.graphql b/lib/graphql/Fragments/Blocks/Card.graphql new file mode 100644 index 000000000..99ae37916 --- /dev/null +++ b/lib/graphql/Fragments/Blocks/Card.graphql @@ -0,0 +1,49 @@ +fragment CardBlock on Card { + heading + body_text + background_image + scripted_top_title + title + secondary_button { + is_contentstack_link + cta_text + open_in_new_tab + external_link { + title + href + } + linkConnection { + edges { + node { + __typename + ...LoyaltyPageLink + ...ContentPageLink + ...AccountPageLink + } + } + } + } + primary_button { + is_contentstack_link + cta_text + open_in_new_tab + external_link { + title + href + } + linkConnection { + edges { + node { + __typename + ...LoyaltyPageLink + ...ContentPageLink + ...AccountPageLink + } + } + } + } + system { + locale + uid + } +} diff --git a/lib/graphql/Fragments/Blocks/Refs/Card.graphql b/lib/graphql/Fragments/Blocks/Refs/Card.graphql new file mode 100644 index 000000000..3b3c33a9a --- /dev/null +++ b/lib/graphql/Fragments/Blocks/Refs/Card.graphql @@ -0,0 +1,29 @@ +fragment CardBlockRef on Card { + secondary_button { + linkConnection { + edges { + node { + __typename + ...LoyaltyPageRef + ...ContentPageRef + ...AccountPageRef + } + } + } + } + primary_button { + linkConnection { + edges { + node { + __typename + ...LoyaltyPageRef + ...ContentPageRef + ...AccountPageRef + } + } + } + } + system { + ...System + } +} diff --git a/lib/graphql/Query/LoyaltyPage.graphql b/lib/graphql/Query/LoyaltyPage.graphql index 8e2ae2f61..0ea366416 100644 --- a/lib/graphql/Query/LoyaltyPage.graphql +++ b/lib/graphql/Query/LoyaltyPage.graphql @@ -1,4 +1,6 @@ #import "../Fragments/Image.graphql" +#import "../Fragments/Blocks/Card.graphql" +#import "../Fragments/Blocks/Refs/Card.graphql" #import "../Fragments/PageLink/AccountPageLink.graphql" #import "../Fragments/PageLink/ContentPageLink.graphql" #import "../Fragments/PageLink/LoyaltyPageLink.graphql" @@ -11,8 +13,8 @@ query GetLoyaltyPage($locale: String!, $uid: String!) { loyalty_page(uid: $uid, locale: $locale) { blocks { - __typename ... on LoyaltyPageBlocksShortcuts { + __typename shortcuts { title preamble @@ -22,10 +24,9 @@ query GetLoyaltyPage($locale: String!, $uid: String!) { linkConnection { edges { node { - __typename - ...AccountPageLink ...LoyaltyPageLink ...ContentPageLink + ...AccountPageLink } } totalCount @@ -34,6 +35,7 @@ query GetLoyaltyPage($locale: String!, $uid: String!) { } } ... on LoyaltyPageBlocksDynamicContent { + __typename dynamic_content { title subtitle @@ -52,30 +54,8 @@ query GetLoyaltyPage($locale: String!, $uid: String!) { } } } - ... on LoyaltyPageBlocksCardGrid { - card_grid { - title - subtitle - cards { - referenceConnection { - edges { - node { - __typename - ...LoyaltyPageLink - ...ContentPageLink - ...AccountPageLink - } - } - totalCount - } - title - subtitle - open_in_new_tab - cta_text - } - } - } ... on LoyaltyPageBlocksContent { + __typename content { content { json @@ -83,7 +63,6 @@ query GetLoyaltyPage($locale: String!, $uid: String!) { edges { node { __typename - ...Image ...LoyaltyPageLink ...ContentPageLink } @@ -93,6 +72,22 @@ query GetLoyaltyPage($locale: String!, $uid: String!) { } } } + ... on LoyaltyPageBlocksCardsGrid { + __typename + cards_grid { + title + preamble + layout + theme + cardConnection(limit: 10) { + edges { + node { + ...CardBlock + } + } + } + } + } } title heading @@ -185,23 +180,6 @@ query GetLoyaltyPageRefs($locale: String!, $uid: String!) { } } } - ... on LoyaltyPageBlocksCardGrid { - __typename - card_grid { - cards { - referenceConnection { - edges { - node { - __typename - ...AccountPageRef - ...ContentPageRef - ...LoyaltyPageRef - } - } - } - } - } - } ... on LoyaltyPageBlocksContent { __typename content { @@ -228,6 +206,18 @@ query GetLoyaltyPageRefs($locale: String!, $uid: String!) { } } } + ... on LoyaltyPageBlocksCardsGrid { + __typename + cards_grid { + cardConnection(limit: 10) { + edges { + node { + ...CardBlockRef + } + } + } + } + } } sidebar { ... on LoyaltyPageSidebarContent { diff --git a/server/routers/contentstack/loyaltyPage/output.ts b/server/routers/contentstack/loyaltyPage/output.ts index 3a1292e99..87d4cc895 100644 --- a/server/routers/contentstack/loyaltyPage/output.ts +++ b/server/routers/contentstack/loyaltyPage/output.ts @@ -13,37 +13,22 @@ import { PageLinkEnum } from "@/types/requests/pageLinks" import { EdgesWithTotalCount } from "@/types/requests/utils/edges" import { RTEDocument } from "@/types/rte/node" -const loyaltyPageBlockCardGrid = z.object({ - __typename: z.literal(LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid), - card_grid: z.object({ - title: z.string().nullable(), - subtitle: z.string().nullable(), - cards: z.array( - z.object({ - title: z.string().nullable(), - subtitle: z.string().nullable(), - referenceConnection: z.object({ - edges: z.array( - z.object({ - node: z.object({ - system: z.object({ - uid: z.string(), - locale: z.nativeEnum(Lang), - }), - url: z.string(), - title: z.string(), - __typename: z.string(), - }), - }) - ), - totalCount: z.number(), +const pageLink = z.object({ + edges: z.array( + z.object({ + node: z.object({ + system: z.object({ + uid: z.string(), + locale: z.nativeEnum(Lang), }), - open_in_new_tab: z.boolean(), - cta_text: z.string().nullable(), - }) - ), - }), + url: z.string(), + title: z.string(), + __typename: z.string(), + }), + }) + ), }) + const loyaltyPageDynamicContent = z.object({ __typename: z.literal( LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksDynamicContent @@ -93,7 +78,8 @@ const loyaltyPageShortcuts = z.object({ .object({ original_url: z.string().nullable(), }) - .nullable(), + .nullable() + .optional(), title: z.string(), }), }) @@ -107,6 +93,59 @@ const loyaltyPageShortcuts = z.object({ }), }) +const cardBlock = z.object({ + heading: z.string().nullable(), + body_text: z.string().nullable(), + background_image: z.any(), + scripted_top_title: z.string().nullable(), + primary_button: z + .object({ + is_contentstack_link: z.boolean(), + cta_text: z.string().nullable(), + open_in_new_tab: z.boolean(), + external_link: z.object({ + title: z.string().nullable(), + href: z.string().nullable(), + }), + linkConnection: pageLink, + }) + .nullable(), + secondary_button: z + .object({ + is_contentstack_link: z.boolean(), + cta_text: z.string().nullable(), + open_in_new_tab: z.boolean().nullable(), + external_link: z.object({ + title: z.string().nullable(), + href: z.string().nullable(), + }), + linkConnection: pageLink, + }) + .nullable(), + + system: z.object({ + locale: z.nativeEnum(Lang), + uid: z.string(), + }), +}) + +const loyaltyPageCards = z.object({ + __typename: z.literal(LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid), + cards_grid: z.object({ + title: z.string().nullable(), + preamble: z.string().nullable(), + layout: z.enum(["twoColumnGrid", "threeColumnGrid", "twoPlusOne"]), + theme: z.enum(["one", "two", "three"]).nullable(), + cardConnection: z.object({ + edges: z.array( + z.object({ + node: cardBlock, + }) + ), + }), + }), +}) + const loyaltyPageBlockTextContent = z.object({ __typename: z.literal(LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent), content: z.object({ @@ -121,10 +160,10 @@ const loyaltyPageBlockTextContent = z.object({ }) const loyaltyPageBlockItem = z.discriminatedUnion("__typename", [ - loyaltyPageBlockCardGrid, loyaltyPageDynamicContent, loyaltyPageBlockTextContent, loyaltyPageShortcuts, + loyaltyPageCards, ]) const loyaltyPageSidebarTextContent = z.object({ @@ -178,26 +217,6 @@ export const validateLoyaltyPageSchema = z.object({ }) // Block types -type CardGridRaw = z.infer - -export type CardGridCard = Omit< - CardGridRaw["card_grid"]["cards"][number], - "referenceConnection" -> & { - link: - | { - href: string - title: string - } - | undefined -} - -export type CardGrid = Omit & { - card_grid: Omit & { - cards: CardGridCard[] - } -} - type DynamicContentRaw = z.infer export type DynamicContent = Omit & { @@ -222,6 +241,43 @@ export interface RteBlockContent extends BlockContentRaw { } } +type CardsGridRaw = z.infer + +export type CardsGrid = Omit & { + cards_grid: Omit & { + cards: { + system: { + locale: Lang + uid: string + } + heading: string | null + body_text: string | null + scripted_top_title: string | null + primaryButton: + | { + open_in_new_tab: boolean + link: { + title: string + href: string + } + isExternal: boolean + } + | undefined + secondaryButton: + | { + open_in_new_tab: boolean + link: { + title: string + href: string + } + isExternal: boolean + } + | undefined + background_image?: any + }[] + } +} + type ShortcutsRaw = z.infer export type Shortcuts = Omit & { @@ -235,7 +291,7 @@ export type Shortcuts = Omit & { } } -export type Block = CardGrid | RteBlockContent | DynamicContent | Shortcuts +export type Block = RteBlockContent | DynamicContent | Shortcuts | CardsGrid // Sidebar block types type SidebarContentRaw = z.infer @@ -275,14 +331,34 @@ const pageConnectionRefs = z.object({ ), }) -const loyaltyPageBlockCardGridRefs = z.object({ - __typename: z.literal(LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid), - card_grid: z.object({ - cards: z.array( - z.object({ - referenceConnection: pageConnectionRefs, - }) - ), +const cardBlockRefs = z.object({ + primary_button: z + .object({ + linkConnection: pageConnectionRefs, + }) + .nullable(), + secondary_button: z + .object({ + linkConnection: pageConnectionRefs, + }) + .nullable(), + + system: z.object({ + content_type_uid: z.string(), + uid: z.string(), + }), +}) + +const loyaltyPageCardsRefs = z.object({ + __typename: z.literal(LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid), + cards_grid: z.object({ + cardConnection: z.object({ + edges: z.array( + z.object({ + node: cardBlockRefs, + }) + ), + }), }), }) @@ -318,10 +394,10 @@ const loyaltyPageBlockTextContentRefs = z.object({ }) const loyaltyPageBlocRefsItem = z.discriminatedUnion("__typename", [ - loyaltyPageBlockCardGridRefs, loyaltyPageDynamicContentRefs, loyaltyPageBlockTextContentRefs, loyaltyPageShortcutsRefs, + loyaltyPageCardsRefs, ]) const loyaltyPageSidebarTextContentRef = z.object({ diff --git a/server/routers/contentstack/loyaltyPage/query.ts b/server/routers/contentstack/loyaltyPage/query.ts index e9bb4f336..a0da16d26 100644 --- a/server/routers/contentstack/loyaltyPage/query.ts +++ b/server/routers/contentstack/loyaltyPage/query.ts @@ -60,6 +60,8 @@ export const loyaltyPageQueryRouter = router({ const validatedLoyaltyPageRefs = validateLoyaltyPageRefsSchema.safeParse(cleanedData) if (!validatedLoyaltyPageRefs.success) { + console.error("Bad validation for `GetLoyaltyPageRefs`") + console.error(validatedLoyaltyPageRefs.error) throw internalServerError(validatedLoyaltyPageRefs.error) } @@ -114,24 +116,6 @@ export const loyaltyPageQueryRouter = router({ const blocks = validatedLoyaltyPage.data.loyalty_page.blocks ? validatedLoyaltyPage.data.loyalty_page.blocks.map((block) => { switch (block.__typename) { - case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid: - return { - ...block, - card_grid: { - ...block.card_grid, - cards: block.card_grid.cards.map((card) => { - return { - ...card, - link: card.referenceConnection.totalCount - ? { - href: `/${card.referenceConnection.edges[0].node.system.locale}${card.referenceConnection.edges[0].node.url}`, - title: card.cta_text || _("Read more"), - } - : undefined, - } - }), - }, - } case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksDynamicContent: return { ...block, @@ -174,6 +158,70 @@ export const loyaltyPageQueryRouter = router({ })), }, } + case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid: + return { + ...block, + cards_grid: { + ...block.cards_grid, + cards: block.cards_grid.cardConnection.edges.map( + ({ node: card }) => { + const primaryButton = card.primary_button + ? { + open_in_new_tab: + card.primary_button.open_in_new_tab, + link: { + title: + card.primary_button.cta_text || + (card.primary_button.is_contentstack_link && + card.primary_button.linkConnection.edges.length + ? card.primary_button.linkConnection.edges[0] + .node.title + : card.primary_button.external_link.title), + href: + card.primary_button.is_contentstack_link && + card.primary_button.linkConnection.edges.length + ? `/${card.primary_button.linkConnection.edges[0].node.system.locale}${card.primary_button.linkConnection.edges[0].node.url}` + : card.primary_button.external_link.href, + }, + isExternal: + !card.primary_button.is_contentstack_link, + } + : undefined + + const secondaryButton = card.secondary_button + ? { + open_in_new_tab: + card.secondary_button.open_in_new_tab, + link: { + title: + card.secondary_button.cta_text || + (card.secondary_button.is_contentstack_link && + card.secondary_button.linkConnection.edges + .length + ? card.secondary_button.linkConnection + .edges[0].node.title + : card.secondary_button.external_link.title), + href: + card.secondary_button.is_contentstack_link && + card.secondary_button.linkConnection.edges + .length + ? `/${card.secondary_button.linkConnection.edges[0].node.system.locale}${card.secondary_button.linkConnection.edges[0].node.url}` + : card.secondary_button.external_link.title, + }, + isExternal: + !card.secondary_button.is_contentstack_link, + } + : undefined + + return { + ...card, + primaryButton, + secondaryButton, + } + } + ), + }, + } default: return block } diff --git a/server/routers/contentstack/loyaltyPage/utils.ts b/server/routers/contentstack/loyaltyPage/utils.ts index 0cb452efa..e56207061 100644 --- a/server/routers/contentstack/loyaltyPage/utils.ts +++ b/server/routers/contentstack/loyaltyPage/utils.ts @@ -15,12 +15,16 @@ export function getConnections(refs: LoyaltyPageRefsDataRaw) { } break } - case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid: { - item.card_grid.cards.forEach((card) => { - if (card.referenceConnection.edges.length) { - connections.push(card.referenceConnection) + case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardsGrid: { + connections.push(item.cards_grid.cardConnection) + item.cards_grid.cardConnection.edges.forEach((card) => { + if (card.node.primary_button) { + connections.push(card.node.primary_button?.linkConnection) + } else if (card.node.secondary_button) { + connections.push(card.node.secondary_button?.linkConnection) } }) + break } case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksShortcuts: { diff --git a/types/components/loyalty/blocks.ts b/types/components/loyalty/blocks.ts index 4e3efbedc..690a7350b 100644 --- a/types/components/loyalty/blocks.ts +++ b/types/components/loyalty/blocks.ts @@ -1,6 +1,6 @@ import { Block, - CardGrid, + CardsGrid, DynamicContent, RteBlockContent, } from "@/server/routers/contentstack/loyaltyPage/output" @@ -17,7 +17,7 @@ export type DynamicComponentProps = { component: DynamicContent["dynamic_content"]["component"] } -export type CardGridProps = Pick +export type CardsGridProps = Pick export type Content = { content: RteBlockContent["content"]["content"] } diff --git a/types/components/loyalty/enums.ts b/types/components/loyalty/enums.ts index 687c40d63..077c439cb 100644 --- a/types/components/loyalty/enums.ts +++ b/types/components/loyalty/enums.ts @@ -27,7 +27,7 @@ export type LoyaltyComponent = keyof typeof LoyaltyComponentEnum export enum LoyaltyBlocksTypenameEnum { LoyaltyPageBlocksDynamicContent = "LoyaltyPageBlocksDynamicContent", - LoyaltyPageBlocksCardGrid = "LoyaltyPageBlocksCardGrid", LoyaltyPageBlocksContent = "LoyaltyPageBlocksContent", LoyaltyPageBlocksShortcuts = "LoyaltyPageBlocksShortcuts", + LoyaltyPageBlocksCardsGrid = "LoyaltyPageBlocksCardsGrid", }