x
This commit is contained in:
1 parent
78b722e120
commit
75770ca122
18 files changed
+1119
-318
No files matched your search
@@ -239,6 +239,72 @@ export interface StoreSettingsTranslation {
|
||||
updatedAt?: string
|
||||
}
|
||||
|
||||
export const FooterColumnSchema = z.enum([
|
||||
'brand',
|
||||
'explore',
|
||||
'collections',
|
||||
'support',
|
||||
])
|
||||
|
||||
export const FooterFinaleSettingsSchema = z.object({
|
||||
enabled: z.boolean(),
|
||||
mode: z.enum(['static', 'curtain']),
|
||||
mobileHeight: z.enum(['compact', 'medium', 'large']),
|
||||
desktopHeight: z.enum(['compact', 'half', 'screen']),
|
||||
logoSize: z.enum(['sm', 'md', 'lg', 'xl']),
|
||||
}).strict()
|
||||
|
||||
export const FooterLayoutSettingsSchema = z.object({
|
||||
columns: z.array(FooterColumnSchema).min(1).max(4).superRefine((columns, context) => {
|
||||
if (new Set(columns).size !== columns.length) {
|
||||
context.addIssue({
|
||||
code: 'custom',
|
||||
message: 'Footer columns must be unique',
|
||||
})
|
||||
}
|
||||
}),
|
||||
mobileColumns: z.union([z.literal(1), z.literal(2)]),
|
||||
desktopColumns: z.union([z.literal(2), z.literal(3), z.literal(4)]),
|
||||
containerWidth: z.enum(['narrow', 'standard', 'wide', 'full']),
|
||||
verticalPadding: z.enum(['sm', 'md', 'lg', 'xl']),
|
||||
columnGap: z.enum(['sm', 'md', 'lg', 'xl']),
|
||||
headingSize: z.enum(['sm', 'md', 'lg']),
|
||||
linkSize: z.enum(['sm', 'md', 'lg']),
|
||||
brandLogoSize: z.enum(['sm', 'md', 'lg', 'xl']),
|
||||
socialSize: z.enum(['sm', 'md', 'lg']),
|
||||
finale: FooterFinaleSettingsSchema,
|
||||
}).strict()
|
||||
|
||||
export const FooterLayoutSettingsPatchSchema = FooterLayoutSettingsSchema
|
||||
.partial()
|
||||
.extend({ finale: FooterFinaleSettingsSchema.partial().strict().optional() })
|
||||
.strict()
|
||||
|
||||
export type FooterColumn = z.infer<typeof FooterColumnSchema>
|
||||
export type FooterFinaleSettings = z.infer<typeof FooterFinaleSettingsSchema>
|
||||
export type FooterLayoutSettings = z.infer<typeof FooterLayoutSettingsSchema>
|
||||
export type FooterLayoutSettingsPatch = z.infer<typeof FooterLayoutSettingsPatchSchema>
|
||||
|
||||
export const DEFAULT_FOOTER_LAYOUT_SETTINGS: FooterLayoutSettings = {
|
||||
columns: ['brand', 'explore', 'collections', 'support'],
|
||||
mobileColumns: 1,
|
||||
desktopColumns: 4,
|
||||
containerWidth: 'standard',
|
||||
verticalPadding: 'lg',
|
||||
columnGap: 'lg',
|
||||
headingSize: 'sm',
|
||||
linkSize: 'md',
|
||||
brandLogoSize: 'md',
|
||||
socialSize: 'md',
|
||||
finale: {
|
||||
enabled: true,
|
||||
mode: 'curtain',
|
||||
mobileHeight: 'medium',
|
||||
desktopHeight: 'screen',
|
||||
logoSize: 'xl',
|
||||
},
|
||||
}
|
||||
|
||||
export interface StoreSettings {
|
||||
id: number
|
||||
brandName: string
|
||||
@@ -260,6 +326,7 @@ export interface StoreSettings {
|
||||
newsletterButtonText?: string | null
|
||||
footerSupportHeading?: any | null
|
||||
footerCopyrightText?: any | null
|
||||
footerLayout?: FooterLayoutSettings | null
|
||||
scrollRevealEnabled?: boolean | null
|
||||
scrollRevealStyle?: string | null
|
||||
scrollRevealDuration?: number | null
|
||||
|
||||
Reference in new issue
Block a user