fix(SW-3305): Added preamble to carousel cards block
Approved-by: Matilda Landström Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -16,6 +16,7 @@ import type { CarouselCardsProps } from "@/types/components/blocks/carouselCards
|
|||||||
export default function CarouselCards({ carousel_cards }: CarouselCardsProps) {
|
export default function CarouselCards({ carousel_cards }: CarouselCardsProps) {
|
||||||
const {
|
const {
|
||||||
heading,
|
heading,
|
||||||
|
preamble,
|
||||||
enableFilters,
|
enableFilters,
|
||||||
defaultFilter,
|
defaultFilter,
|
||||||
filterCategories,
|
filterCategories,
|
||||||
@@ -37,6 +38,7 @@ export default function CarouselCards({ carousel_cards }: CarouselCardsProps) {
|
|||||||
<SectionContainer>
|
<SectionContainer>
|
||||||
<SectionHeader
|
<SectionHeader
|
||||||
title={heading}
|
title={heading}
|
||||||
|
preamble={preamble}
|
||||||
headingLevel="h2"
|
headingLevel="h2"
|
||||||
headingAs="h3"
|
headingAs="h3"
|
||||||
link={link}
|
link={link}
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ fragment CarouselCards_StartPageRefs on StartPageBlocksCarouselCards {
|
|||||||
fragment CarouselCards_CampaignPage on CampaignPageBlocksCarouselCards {
|
fragment CarouselCards_CampaignPage on CampaignPageBlocksCarouselCards {
|
||||||
carousel_cards {
|
carousel_cards {
|
||||||
heading
|
heading
|
||||||
|
preamble
|
||||||
enable_filters
|
enable_filters
|
||||||
card_groups {
|
card_groups {
|
||||||
filter_label
|
filter_label
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { linkConnectionRefsSchema } from "./utils/linkConnection"
|
|||||||
|
|
||||||
const commonFields = {
|
const commonFields = {
|
||||||
heading: z.string().optional(),
|
heading: z.string().optional(),
|
||||||
|
preamble: z.string().nullish(),
|
||||||
link: buttonSchema.nullish(),
|
link: buttonSchema.nullish(),
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
@@ -103,6 +104,7 @@ export const carouselCardsSchema = z.object({
|
|||||||
if (!data.enable_filters) {
|
if (!data.enable_filters) {
|
||||||
return {
|
return {
|
||||||
heading: data.heading,
|
heading: data.heading,
|
||||||
|
preamble: data.preamble,
|
||||||
enableFilters: false,
|
enableFilters: false,
|
||||||
filterCategories: [],
|
filterCategories: [],
|
||||||
cards: data.card_groups.map((group) => group.cards).flat(),
|
cards: data.card_groups.map((group) => group.cards).flat(),
|
||||||
@@ -121,6 +123,7 @@ export const carouselCardsSchema = z.object({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
heading: data.heading,
|
heading: data.heading,
|
||||||
|
preamble: data.preamble,
|
||||||
enableFilters: true,
|
enableFilters: true,
|
||||||
filterCategories,
|
filterCategories,
|
||||||
cards: data.card_groups.map((group) => group.cards).flat(),
|
cards: data.card_groups.map((group) => group.cards).flat(),
|
||||||
|
|||||||
Reference in New Issue
Block a user