fix: validation for header
This commit is contained in:
@@ -1,41 +1,19 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
validateLinkItem,
|
||||
validateLinksWithType,
|
||||
validateSecondaryLinks,
|
||||
} from "@/server/routers/contentstack/base/output"
|
||||
|
||||
import type { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
|
||||
export type FooterLink = z.output<typeof validateLinkItem>
|
||||
import type {
|
||||
FooterLink,
|
||||
FooterLinkWithType,
|
||||
FooterSecondaryNavGroup,
|
||||
} from "@/types/trpc/routers/contentstack/footer"
|
||||
|
||||
export type FooterMainNavProps = {
|
||||
mainLinks: FooterLink[]
|
||||
}
|
||||
|
||||
type FooterSecondaryNavGroup = z.output<typeof validateSecondaryLinks>
|
||||
|
||||
type FooterLinkWithType = z.output<typeof validateLinksWithType>
|
||||
|
||||
type FooterAppDownloads = {
|
||||
title: string
|
||||
links: FooterLinkWithType
|
||||
}
|
||||
|
||||
type FooterSocialMedia = {
|
||||
links: FooterLinkWithType
|
||||
}
|
||||
|
||||
export type FooterSecondaryNavProps = {
|
||||
secondaryLinks: FooterSecondaryNavGroup
|
||||
appDownloads: FooterAppDownloads
|
||||
}
|
||||
|
||||
export type FooterDetailsProps = {
|
||||
socialMedia?: FooterSocialMedia
|
||||
tertiaryLinks?: FooterLink[]
|
||||
languageUrls?: LanguageSwitcherData
|
||||
}
|
||||
|
||||
export type FooterNavigationProps = FooterMainNavProps & FooterSecondaryNavProps
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Header, MenuItem } from "@/types/header"
|
||||
import type { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
import type { Header } from "@/types/trpc/routers/contentstack/header"
|
||||
|
||||
export interface MobileMenuProps {
|
||||
languageUrls: LanguageSwitcherData
|
||||
topLink: Header["topLink"]
|
||||
topLink: Header["header"]["topLink"]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MenuItem } from "@/types/header"
|
||||
import type { MenuItem } from "@/types/trpc/routers/contentstack/header"
|
||||
|
||||
export interface NavigationMenuItemProps {
|
||||
item: MenuItem
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MenuItem } from "@/types/header"
|
||||
import type { MenuItem } from "@/types/trpc/routers/contentstack/header"
|
||||
|
||||
export interface NavigationMenuListProps {
|
||||
isMobile: boolean
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
getHeaderRefSchema,
|
||||
getHeaderSchema,
|
||||
menuItemSchema,
|
||||
} from "@/server/routers/contentstack/base/output"
|
||||
|
||||
export type HeaderRefResponse = z.input<typeof getHeaderRefSchema>
|
||||
export type HeaderResponse = z.input<typeof getHeaderSchema>
|
||||
export type Header = z.output<typeof getHeaderSchema>
|
||||
export type MenuItem = z.output<typeof menuItemSchema>
|
||||
11
types/trpc/routers/contentstack/footer.ts
Normal file
11
types/trpc/routers/contentstack/footer.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
validateLinkItem,
|
||||
validateLinksWithType,
|
||||
validateSecondaryLinks,
|
||||
} from "@/server/routers/contentstack/base/output"
|
||||
|
||||
export type FooterLink = z.output<typeof validateLinkItem>
|
||||
export type FooterSecondaryNavGroup = z.output<typeof validateSecondaryLinks>
|
||||
export type FooterLinkWithType = z.output<typeof validateLinksWithType>
|
||||
15
types/trpc/routers/contentstack/header.ts
Normal file
15
types/trpc/routers/contentstack/header.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
headerRefsSchema,
|
||||
headerSchema,
|
||||
menuItemSchema,
|
||||
} from "@/server/routers/contentstack/base/output"
|
||||
|
||||
export type GetHeaderRefs = z.input<typeof headerRefsSchema>
|
||||
export type HeaderRefs = NonNullable<z.output<typeof headerRefsSchema>>
|
||||
|
||||
export type GetHeader = z.input<typeof headerSchema>
|
||||
export type Header = z.output<typeof headerSchema>
|
||||
|
||||
export type MenuItem = z.output<typeof menuItemSchema>
|
||||
Reference in New Issue
Block a user