Merged in LOY-188-employee-benefit-call-to-actions (pull request #1954)
feat(LOY-188): dynamic content support in content pages headers & use in DTMC employee benefits page * feat(LOY-188): add dynamic content handling for DTMC employee benefits page header * fix(LOY-188): change section to div in EmployeeBenefitsCallToActions component * refactor(LOY-188): switch to ButtonLink * refactor(LOY-188): replace enum with as const objects in DynamicContentEnum * chore(LOY-188): change ComponentValue type exports to internal scope in DynamicContentEnum * fix(EmployeeBenefitsCallToActions): replace div with fragment * chore(LOY-188): update translations Approved-by: Christian Andolf
This commit is contained in:
@@ -26,6 +26,10 @@ import {
|
||||
import { tableSchema } from "../schemas/blocks/table"
|
||||
import { textColsRefsSchema, textColsSchema } from "../schemas/blocks/textCols"
|
||||
import { uspGridRefsSchema, uspGridSchema } from "../schemas/blocks/uspGrid"
|
||||
import {
|
||||
dynamicContentRefsSchema as headerDynamicContentRefsSchema,
|
||||
dynamicContentSchema as headerDynamicContentSchema,
|
||||
} from "../schemas/headers/dynamicContent"
|
||||
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
||||
import {
|
||||
linkAndTitleSchema,
|
||||
@@ -210,6 +214,7 @@ export const contentPageSchema = z.object({
|
||||
preamble: z.string(),
|
||||
top_primary_button: topPrimaryButtonSchema,
|
||||
navigation_links: navigationLinksSchema,
|
||||
dynamic_content: headerDynamicContentSchema.optional(),
|
||||
}),
|
||||
meeting_package: z
|
||||
.object({
|
||||
@@ -325,6 +330,7 @@ const contentPageSidebarRefsItem = z.discriminatedUnion("__typename", [
|
||||
const contentPageHeaderRefs = z.object({
|
||||
navigation_links: z.array(linkConnectionRefs),
|
||||
top_primary_button: linkConnectionRefs.nullable(),
|
||||
dynamic_content: headerDynamicContentRefsSchema.optional(),
|
||||
})
|
||||
|
||||
export const contentPageRefsSchema = z.object({
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { DynamicContentEnum } from "@/types/enums/dynamicContent"
|
||||
|
||||
export const dynamicContentSchema = z.object({
|
||||
component: z.enum(DynamicContentEnum.Headers.enums),
|
||||
})
|
||||
|
||||
export const dynamicContentRefsSchema = z.object({
|
||||
component: z.enum(DynamicContentEnum.Headers.enums),
|
||||
})
|
||||
Reference in New Issue
Block a user