feat(SW-190): added hero to static content pages

This commit is contained in:
Erik Tiekstra
2024-08-14 09:29:00 +02:00
parent f1ca9a0704
commit 8220a39a8f
23 changed files with 351 additions and 64 deletions
@@ -191,11 +191,8 @@ const loyaltyPageSidebarItem = z.discriminatedUnion("__typename", [
export const validateLoyaltyPageSchema = z.object({
heading: z.string().nullable(),
header: z
.object({
hero_image: z.any(),
})
.nullable(),
preamble: z.string().nullable(),
hero_image: z.any().nullable(),
blocks: z.array(loyaltyPageBlockItem).nullable(),
sidebar: z.array(loyaltyPageSidebarItem).nullable(),
system: z.object({
@@ -263,7 +260,11 @@ export type Sidebar =
| SideBarDynamicContent
type LoyaltyPageDataRaw = z.infer<typeof validateLoyaltyPageSchema>
export type LoyaltyPage = Omit<LoyaltyPageDataRaw, "blocks" | "sidebar"> & {
export type LoyaltyPage = Omit<
LoyaltyPageDataRaw,
"blocks" | "sidebar" | "hero_image"
> & {
hero_image?: ImageVaultAsset
blocks: Block[]
sidebar: Sidebar[]
}