fix: refactor language switcher
This commit is contained in:
@@ -132,6 +132,8 @@ const validateHeaderRefConfigSchema = z.object({
|
||||
}),
|
||||
})
|
||||
|
||||
export type HeaderRefDataRaw = z.infer<typeof validateHeaderRefConfigSchema>
|
||||
|
||||
const validateAppDownload = z.object({
|
||||
href: z.string(),
|
||||
imageConnection: z.object({
|
||||
@@ -155,9 +157,6 @@ const validateAppDownload = z.object({
|
||||
}),
|
||||
})
|
||||
|
||||
export type HeaderRefDataRaw = z.infer<typeof validateHeaderRefConfigSchema>
|
||||
|
||||
|
||||
const validateNavigationItem = z.object({
|
||||
links: z.array(z.object({ href: z.string(), title: z.string() })),
|
||||
title: z.string(),
|
||||
@@ -240,3 +239,27 @@ export type FooterData = Omit<
|
||||
> & {
|
||||
logo: Image
|
||||
}
|
||||
|
||||
const validateFooterRefConfigSchema = z.object({
|
||||
all_current_footer: z.object({
|
||||
items: z.array(
|
||||
z.object({
|
||||
system: z.object({
|
||||
content_type_uid: z.string(),
|
||||
uid: z.string(),
|
||||
}),
|
||||
})
|
||||
),
|
||||
}),
|
||||
})
|
||||
|
||||
export type FooterRefDataRaw = z.infer<typeof validateFooterRefConfigSchema>
|
||||
|
||||
export const validateLanguageSwitcherData = z.object({
|
||||
en: z.object({ url: z.string(), isExternal: z.boolean() }).optional(),
|
||||
da: z.object({ url: z.string(), isExternal: z.boolean() }).optional(),
|
||||
de: z.object({ url: z.string(), isExternal: z.boolean() }).optional(),
|
||||
fi: z.object({ url: z.string(), isExternal: z.boolean() }).optional(),
|
||||
sv: z.object({ url: z.string(), isExternal: z.boolean() }).optional(),
|
||||
no: z.object({ url: z.string(), isExternal: z.boolean() }).optional(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user