diff --git a/components/TempDesignSystem/LinkChips/Chip/index.tsx b/components/TempDesignSystem/LinkChips/Chip/index.tsx index 791037906..6ec804629 100644 --- a/components/TempDesignSystem/LinkChips/Chip/index.tsx +++ b/components/TempDesignSystem/LinkChips/Chip/index.tsx @@ -3,10 +3,10 @@ import Link from "next/link" import { ChevronRightSmallIcon } from "@/components/Icons" import Caption from "@/components/TempDesignSystem/Text/Caption" -import { LinkChipProps } from "./chip" - import styles from "./chip.module.css" +import type { LinkChipProps } from "./chip" + export default function LinkChip({ url, title }: LinkChipProps) { return ( diff --git a/components/TempDesignSystem/LinkChips/index.tsx b/components/TempDesignSystem/LinkChips/index.tsx index 2d6e12881..dccefd9db 100644 --- a/components/TempDesignSystem/LinkChips/index.tsx +++ b/components/TempDesignSystem/LinkChips/index.tsx @@ -1,8 +1,9 @@ import LinkChip from "./Chip" -import { LinkChipsProps } from "./linkChips" import styles from "./linkChips.module.css" +import type { LinkChipsProps } from "./linkChips" + export default function LinkChips({ chips }: LinkChipsProps) { if (!chips.length) { return null diff --git a/components/TempDesignSystem/LinkChips/linkChips.ts b/components/TempDesignSystem/LinkChips/linkChips.ts index 361cd07ed..dcc2be2a3 100644 --- a/components/TempDesignSystem/LinkChips/linkChips.ts +++ b/components/TempDesignSystem/LinkChips/linkChips.ts @@ -1,4 +1,4 @@ -import { LinkChipProps } from "./Chip/chip" +import type { LinkChipProps } from "./Chip/chip" export interface LinkChipsProps { chips: LinkChipProps[] diff --git a/server/routers/contentstack/contentPage/output.ts b/server/routers/contentstack/contentPage/output.ts index 398abb372..d4b02d33e 100644 --- a/server/routers/contentstack/contentPage/output.ts +++ b/server/routers/contentstack/contentPage/output.ts @@ -11,8 +11,8 @@ import { contentSchema as blockContentSchema, } from "../schemas/blocks/content" import { - dynamicContentSchema as blockDynamicContentSchema, dynamicContentRefsSchema, + dynamicContentSchema as blockDynamicContentSchema, } from "../schemas/blocks/dynamicContent" import { shortcutsRefsSchema, @@ -21,6 +21,10 @@ import { import { textColsRefsSchema, textColsSchema } from "../schemas/blocks/textCols" import { uspGridRefsSchema, uspGridSchema } from "../schemas/blocks/uspGrid" import { tempImageVaultAssetSchema } from "../schemas/imageVault" +import { + linkAndTitleSchema, + linkConnectionRefs, +} from "../schemas/linkConnection" import { contentRefsSchema as sidebarContentRefsSchema, contentSchema as sidebarContentSchema, @@ -32,18 +36,7 @@ import { } from "../schemas/sidebar/joinLoyaltyContact" import { systemSchema } from "../schemas/system" -import * as pageLinks from "@/server/routers/contentstack/schemas/pageLinks" import { ContentPageEnum } from "@/types/enums/contentPage" -import { - linkAndTitleSchema, - linkConnectionRefs, -} from "../schemas/linkConnection" - -const linkUnionSchema = z.discriminatedUnion("__typename", [ - pageLinks.contentPageSchema, - pageLinks.hotelPageSchema, - pageLinks.loyaltyPageSchema, -]) // Block schemas export const contentPageCards = z @@ -127,7 +120,10 @@ const navigationLinksSchema = z return data .filter((item) => !!item.link) - .map((item) => ({ url: item.link.url, title: item.title })) + .map((item) => ({ + url: item.link!.url, + title: item.title || item.link!.title, + })) }) // Content Page Schema and types diff --git a/server/routers/contentstack/schemas/linkConnection.ts b/server/routers/contentstack/schemas/linkConnection.ts index aff9b980c..f70e8dd81 100644 --- a/server/routers/contentstack/schemas/linkConnection.ts +++ b/server/routers/contentstack/schemas/linkConnection.ts @@ -1,7 +1,5 @@ import { z } from "zod" - - import { discriminatedUnion } from "@/lib/discriminatedUnion" import * as pageLinks from "@/server/routers/contentstack/schemas/pageLinks"