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:
@@ -0,0 +1,5 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { dynamicContentSchema } from "@/server/routers/contentstack/schemas/headers/dynamicContent"
|
||||
|
||||
export type HeaderDynamicContentProps = z.infer<typeof dynamicContentSchema>
|
||||
@@ -1,61 +1,90 @@
|
||||
// Helper type to get a union of an object's string literal values
|
||||
type ValueOf<T> = T[keyof T]
|
||||
|
||||
export namespace DynamicContentEnum {
|
||||
export namespace Blocks {
|
||||
export const enum components {
|
||||
current_benefits = "current_benefits",
|
||||
earn_and_burn = "earn_and_burn",
|
||||
expiring_points = "expiring_points",
|
||||
how_it_works = "how_it_works",
|
||||
jobylon_feed = "jobylon_feed",
|
||||
loyalty_levels = "loyalty_levels",
|
||||
membership_overview = "membership_overview",
|
||||
my_points = "my_points",
|
||||
next_benefits = "next_benefits",
|
||||
overview_table = "overview_table",
|
||||
points_overview = "points_overview",
|
||||
previous_stays = "previous_stays",
|
||||
sign_up_form = "sign_up_form",
|
||||
sign_up_verification = "sign_up_verification",
|
||||
soonest_stays = "soonest_stays",
|
||||
upcoming_stays = "upcoming_stays",
|
||||
sas_linked_account = "sas_linked_account",
|
||||
sas_transfer_points = "sas_transfer_points",
|
||||
sas_tier_comparison = "sas_tier_comparison",
|
||||
}
|
||||
export const components = {
|
||||
current_benefits: "current_benefits",
|
||||
earn_and_burn: "earn_and_burn",
|
||||
expiring_points: "expiring_points",
|
||||
how_it_works: "how_it_works",
|
||||
jobylon_feed: "jobylon_feed",
|
||||
loyalty_levels: "loyalty_levels",
|
||||
membership_overview: "membership_overview",
|
||||
my_points: "my_points",
|
||||
next_benefits: "next_benefits",
|
||||
overview_table: "overview_table",
|
||||
points_overview: "points_overview",
|
||||
previous_stays: "previous_stays",
|
||||
sign_up_form: "sign_up_form",
|
||||
sign_up_verification: "sign_up_verification",
|
||||
soonest_stays: "soonest_stays",
|
||||
upcoming_stays: "upcoming_stays",
|
||||
sas_linked_account: "sas_linked_account",
|
||||
sas_transfer_points: "sas_transfer_points",
|
||||
sas_tier_comparison: "sas_tier_comparison",
|
||||
} as const
|
||||
|
||||
/** Type needed to satisfy zod enum type */
|
||||
export const enums: [components, ...components[]] = [
|
||||
components.current_benefits,
|
||||
components.earn_and_burn,
|
||||
components.expiring_points,
|
||||
components.how_it_works,
|
||||
components.jobylon_feed,
|
||||
components.loyalty_levels,
|
||||
components.membership_overview,
|
||||
components.my_points,
|
||||
components.next_benefits,
|
||||
components.overview_table,
|
||||
components.points_overview,
|
||||
components.previous_stays,
|
||||
components.sign_up_form,
|
||||
components.sign_up_verification,
|
||||
components.soonest_stays,
|
||||
components.upcoming_stays,
|
||||
components.sas_linked_account,
|
||||
components.sas_transfer_points,
|
||||
components.sas_tier_comparison,
|
||||
/**
|
||||
* Represents one of the possible component string literal values from Blocks.components.
|
||||
* e.g., "current_benefits" | "earn_and_burn" | ...
|
||||
*/
|
||||
type ComponentValue = ValueOf<typeof components>
|
||||
|
||||
/**
|
||||
* Array of all component string literal values from Blocks.components.
|
||||
* Typed as a non-empty tuple `[ComponentValue, ...ComponentValue[]]`,
|
||||
* to ensure it meets Zod's z.enum() requirements.
|
||||
*/
|
||||
export const enums = Object.values(components) as [
|
||||
ComponentValue,
|
||||
...ComponentValue[],
|
||||
]
|
||||
}
|
||||
|
||||
export namespace Headers {
|
||||
export const components = {
|
||||
dtmc_employee_benefits_call_to_actions:
|
||||
"dtmc_employee_benefits_call_to_actions",
|
||||
} as const
|
||||
|
||||
/**
|
||||
* Represents one of the possible component string literal values from Headers.components.
|
||||
* e.g., "dtmc_employee_benefits_call_to_actions"
|
||||
*/
|
||||
type ComponentValue = ValueOf<typeof components>
|
||||
|
||||
/**
|
||||
* Array of all component string literal values from Headers.components.
|
||||
* Typed as a non-empty tuple `[ComponentValue, ...ComponentValue[]]`,
|
||||
* to ensure it meets Zod's z.enum() requirements.
|
||||
*/
|
||||
export const enums = Object.values(components) as [
|
||||
ComponentValue,
|
||||
...ComponentValue[],
|
||||
]
|
||||
}
|
||||
|
||||
export namespace Sidebar {
|
||||
export const enum components {
|
||||
my_pages_navigation = "my_pages_navigation",
|
||||
employee_benefits_auth_card = "employee_benefits_auth_card",
|
||||
}
|
||||
export const components = {
|
||||
my_pages_navigation: "my_pages_navigation",
|
||||
employee_benefits_auth_card: "employee_benefits_auth_card",
|
||||
} as const
|
||||
|
||||
/** Type needed to satisfy zod enum type */
|
||||
export const enums: [string, ...string[]] = [
|
||||
components.my_pages_navigation,
|
||||
components.employee_benefits_auth_card,
|
||||
/**
|
||||
* Represents one of the possible component string literal values from Sidebar.components.
|
||||
* e.g., "my_pages_navigation" | "employee_benefits_auth_card"
|
||||
*/
|
||||
type ComponentValue = ValueOf<typeof components>
|
||||
|
||||
/**
|
||||
* Array of all component string literal values from Sidebar.components.
|
||||
* Typed as a non-empty tuple `[ComponentValue, ...ComponentValue[]]`,
|
||||
* to ensure it meets Zod's z.enum() requirements.
|
||||
*/
|
||||
export const enums = Object.values(components) as [
|
||||
ComponentValue,
|
||||
...ComponentValue[],
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user