Merged in feat/SW-1384-filterable-carousel-cards (pull request #1235)
feat(SW-1384): add CarouselCards block to start page * feat(SW-1384): add filterable carousel cards block to start page * fix(SW-1384): remove unnecessary link prop from SectionHeader * fix(SW-1384): remove uneeded undefined * fix(SW-1384): better type safety * feat(SW-1384): Add see all link to filterable carousel cards section header * refactor(SW-1384): Replace FilterableCarouselCards with CarouselCards block * fix(SW-1384): Remove CardsEnumType type definition * fix(SW-1384):Implement code review feedback to CarouselCards * refactor(SW-1384): Convert CarouselCardFilterEnum to const enum with type Approved-by: Christian Andolf
This commit is contained in:
@@ -6,6 +6,10 @@ import {
|
||||
cardGridRefsSchema,
|
||||
cardsGridSchema,
|
||||
} from "../schemas/blocks/cardsGrid"
|
||||
import {
|
||||
carouselCardsRefsSchema,
|
||||
carouselCardsSchema,
|
||||
} from "../schemas/blocks/carouselCards"
|
||||
import {
|
||||
fullWidthCampaignBlockRefsSchema,
|
||||
fullWidthCampaignBlockSchema,
|
||||
@@ -21,6 +25,12 @@ const startPageCards = z
|
||||
})
|
||||
.merge(cardsGridSchema)
|
||||
|
||||
const startPageCarouselCards = z
|
||||
.object({
|
||||
__typename: z.literal(StartPageEnum.ContentStack.blocks.CarouselCards),
|
||||
})
|
||||
.merge(carouselCardsSchema)
|
||||
|
||||
const startPageFullWidthCampaign = z
|
||||
.object({
|
||||
__typename: z.literal(StartPageEnum.ContentStack.blocks.FullWidthCampaign),
|
||||
@@ -30,6 +40,7 @@ const startPageFullWidthCampaign = z
|
||||
export const blocksSchema = z.discriminatedUnion("__typename", [
|
||||
startPageCards,
|
||||
startPageFullWidthCampaign,
|
||||
startPageCarouselCards,
|
||||
])
|
||||
|
||||
export const startPageSchema = z.object({
|
||||
@@ -65,9 +76,16 @@ const startPageFullWidthCampaignRef = z
|
||||
})
|
||||
.merge(fullWidthCampaignBlockRefsSchema)
|
||||
|
||||
const startPageCarouselCardsRef = z
|
||||
.object({
|
||||
__typename: z.literal(StartPageEnum.ContentStack.blocks.CarouselCards),
|
||||
})
|
||||
.merge(carouselCardsRefsSchema)
|
||||
|
||||
const startPageBlockRefsItem = z.discriminatedUnion("__typename", [
|
||||
startPageCardsRefs,
|
||||
startPageFullWidthCampaignRef,
|
||||
startPageCarouselCardsRef,
|
||||
])
|
||||
|
||||
export const startPageRefsSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user