Merged in feat/LOY-361-Promo-Campaign-Hero (pull request #2857)
Feat(LOY-363): Promo Campaign Hero * feat(LOY-361): Add Promo Campaign Hero * feat(LOY-361): auth cta's wip * fix(LOY-361): improve hero card css * fix(LOY-361): correct size for button * fix(LOY-361): Make Promo Hero Required * fix(LOY-361): semantic css classes Approved-by: Matilda Landström
This commit is contained in:
@@ -13,6 +13,11 @@ query GetPromoCampaignPage($locale: String!, $uid: String!) {
|
||||
title
|
||||
heading
|
||||
subheading
|
||||
promo_hero {
|
||||
image
|
||||
heading
|
||||
benefits
|
||||
}
|
||||
page_settings {
|
||||
booking_code
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
||||
import { nullableStringValidator } from "@scandic-hotels/common/utils/zod/stringValidator"
|
||||
|
||||
import { systemSchema } from "../schemas/system"
|
||||
@@ -9,12 +10,22 @@ export const CAMPAIGN_TYPES = {
|
||||
POINT: "POINT",
|
||||
} as const
|
||||
|
||||
export const promoHeroSchema = z.object({
|
||||
image: transformedImageVaultAssetSchema,
|
||||
heading: z.string(),
|
||||
benefits: z
|
||||
.array(z.string())
|
||||
.nullish()
|
||||
.transform((data) => data || []),
|
||||
})
|
||||
|
||||
export const promoCampaignPageSchema = z
|
||||
.object({
|
||||
promo_campaign_page: z.object({
|
||||
title: z.string(),
|
||||
heading: z.string(),
|
||||
subheading: z.string().nullish(),
|
||||
promo_hero: promoHeroSchema,
|
||||
page_settings: z
|
||||
.object({
|
||||
booking_code: z.string().nullish(),
|
||||
|
||||
@@ -21,6 +21,8 @@ export interface PromoCampaignPage
|
||||
|
||||
export type PromoCampaignPageData = PromoCampaignPage["promo_campaign_page"]
|
||||
|
||||
export type PromoHero = NonNullable<PromoCampaignPageData["promo_hero"]>
|
||||
|
||||
/* REFS */
|
||||
export interface GetPromoCampaignPageRefsData
|
||||
extends z.input<typeof promoCampaignPageRefsSchema> {}
|
||||
|
||||
Reference in New Issue
Block a user