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:
4
types/components/blocks/carouselCards.ts
Normal file
4
types/components/blocks/carouselCards.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { CarouselCards } from "@/types/trpc/routers/contentstack/blocks"
|
||||
|
||||
export interface CarouselCardsProps
|
||||
extends Pick<CarouselCards, "carousel_cards"> {}
|
||||
@@ -12,5 +12,6 @@ export namespace BlocksEnums {
|
||||
SasTierComparison = "SasTierComparison",
|
||||
HotelListing = "HotelListing",
|
||||
FullWidthCampaign = "FullWidthCampaign",
|
||||
CarouselCards = "CarouselCards",
|
||||
}
|
||||
}
|
||||
|
||||
7
types/enums/cards.ts
Normal file
7
types/enums/cards.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const CardsEnum = {
|
||||
Card: "Card",
|
||||
TeaserCard: "TeaserCard",
|
||||
LoyaltyCard: "LoyaltyCard",
|
||||
InfoCard: "InfoCard",
|
||||
ContentCard: "ContentCard",
|
||||
} as const
|
||||
@@ -1,10 +1,17 @@
|
||||
import { CardsEnum } from "./cards"
|
||||
|
||||
/**
|
||||
* Enums specific to the CardsGrid presentation context.
|
||||
* CardsEnum defines the core card types, while CardsGridEnum defines
|
||||
* which cards are supported in the grid layout.
|
||||
*/
|
||||
export namespace CardsGridEnum {
|
||||
export const enum cards {
|
||||
Card = "Card",
|
||||
LoyaltyCard = "LoyaltyCard",
|
||||
TeaserCard = "TeaserCard",
|
||||
InfoCard = "InfoCard",
|
||||
}
|
||||
export const cards = {
|
||||
Card: CardsEnum.Card,
|
||||
LoyaltyCard: CardsEnum.LoyaltyCard,
|
||||
TeaserCard: CardsEnum.TeaserCard,
|
||||
InfoCard: CardsEnum.InfoCard,
|
||||
} as const satisfies Partial<typeof CardsEnum>
|
||||
}
|
||||
|
||||
export enum CardsGridLayoutEnum {
|
||||
|
||||
9
types/enums/carouselCards.ts
Normal file
9
types/enums/carouselCards.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const CarouselCardFilterEnum = {
|
||||
offers: "offers",
|
||||
popular_hotels: "popular_hotels",
|
||||
popular_cities: "popular_cities",
|
||||
spa_wellness: "spa_wellness",
|
||||
} as const
|
||||
|
||||
export type CarouselCardFilter =
|
||||
(typeof CarouselCardFilterEnum)[keyof typeof CarouselCardFilterEnum]
|
||||
@@ -2,6 +2,7 @@ export namespace StartPageEnum {
|
||||
export namespace ContentStack {
|
||||
export const enum blocks {
|
||||
CardsGrid = "StartPageBlocksCardsGrid",
|
||||
CarouselCards = "StartPageBlocksCarouselCards",
|
||||
FullWidthCampaign = "StartPageBlocksFullWidthCampaign",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type {
|
||||
cardsGridSchema,
|
||||
teaserCardBlockSchema,
|
||||
} from "@/server/routers/contentstack/schemas/blocks/cardsGrid"
|
||||
import type { teaserCardBlockSchema } from "@/server/routers/contentstack/schemas/blocks/cards/teaserCard"
|
||||
import type { cardsGridSchema } from "@/server/routers/contentstack/schemas/blocks/cardsGrid"
|
||||
import type { carouselCardsSchema } from "@/server/routers/contentstack/schemas/blocks/carouselCards"
|
||||
import type { contentSchema } from "@/server/routers/contentstack/schemas/blocks/content"
|
||||
import type { dynamicContentSchema } from "@/server/routers/contentstack/schemas/blocks/dynamicContent"
|
||||
import type { hotelListingSchema } from "@/server/routers/contentstack/schemas/blocks/hotelListing"
|
||||
@@ -27,3 +26,4 @@ interface GetHotelListing extends z.output<typeof hotelListingSchema> {}
|
||||
export type HotelListing = GetHotelListing["hotel_listing"]
|
||||
export interface SasTierComparison
|
||||
extends z.output<typeof sasTierComparisonSchema> {}
|
||||
export interface CarouselCards extends z.output<typeof carouselCardsSchema> {}
|
||||
|
||||
Reference in New Issue
Block a user