Merged in feat/SW-1443-card-gallery-destination-overview (pull request #1362)
feat(SW-1443): added cardGallery block to destination overview page instead of carousel functionality * feat(SW-1443): added cardGallery block to destination overview page instead of carousel functionality Approved-by: Fredrik Thorsson
This commit is contained in:
@@ -5,23 +5,23 @@ import { discriminatedUnionArray } from "@/lib/discriminatedUnion"
|
||||
import { removeMultipleSlashes } from "@/utils/url"
|
||||
|
||||
import {
|
||||
carouselCardsRefsSchema,
|
||||
carouselCardsSchema,
|
||||
} from "../schemas/blocks/carouselCards"
|
||||
cardGalleryRefsSchema,
|
||||
cardGallerySchema,
|
||||
} from "../schemas/blocks/cardGallery"
|
||||
import { systemSchema } from "../schemas/system"
|
||||
|
||||
import { DestinationOverviewPageEnum } from "@/types/enums/destinationOverviewPage"
|
||||
|
||||
const destinationOverviewPageCarouselCards = z
|
||||
const destinationOverviewPageCardGallery = z
|
||||
.object({
|
||||
__typename: z.literal(
|
||||
DestinationOverviewPageEnum.ContentStack.blocks.CarouselCards
|
||||
DestinationOverviewPageEnum.ContentStack.blocks.CardGallery
|
||||
),
|
||||
})
|
||||
.merge(carouselCardsSchema)
|
||||
.merge(cardGallerySchema)
|
||||
|
||||
export const blocksSchema = z.discriminatedUnion("__typename", [
|
||||
destinationOverviewPageCarouselCards,
|
||||
destinationOverviewPageCardGallery,
|
||||
])
|
||||
|
||||
export const destinationOverviewPageSchema = z.object({
|
||||
@@ -62,16 +62,16 @@ export const countryPageUrlSchema = z
|
||||
)
|
||||
|
||||
/** REFS */
|
||||
const destinationOverviewPageCarouselCardsRef = z
|
||||
const destinationOverviewPageCardGalleryRef = z
|
||||
.object({
|
||||
__typename: z.literal(
|
||||
DestinationOverviewPageEnum.ContentStack.blocks.CarouselCards
|
||||
DestinationOverviewPageEnum.ContentStack.blocks.CardGallery
|
||||
),
|
||||
})
|
||||
.merge(carouselCardsRefsSchema)
|
||||
.merge(cardGalleryRefsSchema)
|
||||
|
||||
const blocksRefsSchema = z.discriminatedUnion("__typename", [
|
||||
destinationOverviewPageCarouselCardsRef,
|
||||
destinationOverviewPageCardGalleryRef,
|
||||
])
|
||||
|
||||
export const destinationOverviewPageRefsSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user