diff --git a/components/Current/Blocks/List/index.tsx b/components/Current/Blocks/List/index.tsx index 7a236bc4d..af6629992 100644 --- a/components/Current/Blocks/List/index.tsx +++ b/components/Current/Blocks/List/index.tsx @@ -67,8 +67,9 @@ function ListItem({ listItem }: { listItem: ListItem }) { ) case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink: - const links = listItem.list_item_internal_link.pageConnection.edges - return links.map((link, i) => ( + const link = listItem.list_item_internal_link.pageConnection.edges[0] + const linkUrlWithLocale= `/${link.node.system.locale}${link.node.url}` + return (
  • - + {listItem.list_item_internal_link.link_text}
    {listItem.list_item_internal_link.subtitle}
  • - )) + ) default: return null diff --git a/lib/graphql/Fragments/PageLinks.graphql b/lib/graphql/Fragments/PageLinks.graphql index aef03e93f..84d1bd89e 100644 --- a/lib/graphql/Fragments/PageLinks.graphql +++ b/lib/graphql/Fragments/PageLinks.graphql @@ -1,6 +1,7 @@ fragment CurrentBlocksPageLink on CurrentBlocksPage { system { uid + locale } title url @@ -9,7 +10,8 @@ fragment CurrentBlocksPageLink on CurrentBlocksPage { fragment TempPageLink on TempPage { system { uid + locale } title url -} +} \ No newline at end of file diff --git a/types/requests/blocks/list.ts b/types/requests/blocks/list.ts index c9d05cdd1..abc327c16 100644 --- a/types/requests/blocks/list.ts +++ b/types/requests/blocks/list.ts @@ -1,5 +1,5 @@ import type { Edges } from "../utils/edges" -import type { ExternalLink } from "../utils/externalLink" +import type { TempPageLink } from "../utils/tempPageLink" import type { PageLink } from "../utils/pageLink" import { Typename } from "../utils/typename" @@ -36,7 +36,7 @@ type InternalLinkListItem = Typename< link_text?: string list_item_style: ListItemStyle subtitle?: string - pageConnection: Edges + pageConnection: Edges } }, BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink diff --git a/types/requests/embeds.ts b/types/requests/embeds.ts index fab2414d8..140dab873 100644 --- a/types/requests/embeds.ts +++ b/types/requests/embeds.ts @@ -1,8 +1,5 @@ import type { SysAsset } from "./utils/asset" -import type { ExternalLinkType } from "./utils/externalLink" +import type { TempPageLinkType } from "./utils/tempPageLink" import type { PageLinkType } from "./utils/pageLink" -export type Embeds = - | ExternalLinkType - | PageLinkType - | SysAsset +export type Embeds = TempPageLinkType | PageLinkType | SysAsset diff --git a/types/requests/puff.ts b/types/requests/puff.ts index 820d09577..85cc77c6a 100644 --- a/types/requests/puff.ts +++ b/types/requests/puff.ts @@ -1,7 +1,7 @@ import type { Image } from "../image" import type { Edges } from "./utils/edges" import type { Embeds } from "./embeds" -import type { ExternalLink } from "./utils/externalLink" +import type { TempPageLink } from "./utils/tempPageLink" import type { PageLink } from "./utils/pageLink" import type { RTEDocument } from "../rte/node" @@ -13,7 +13,7 @@ export type Puff = { title: string } link_text?: string - pageConnection: Edges + pageConnection: Edges system: { uid: string } diff --git a/types/requests/utils/pageLink.ts b/types/requests/utils/pageLink.ts index 8555fe17d..810c40ae1 100644 --- a/types/requests/utils/pageLink.ts +++ b/types/requests/utils/pageLink.ts @@ -1,9 +1,11 @@ +import { Lang } from "@/types/lang" import type { EmbedEnum } from "./embeds" import type { Typename } from "./typename" export type PageLink = { system: { uid: string + locale: Lang } title: string url: string diff --git a/types/requests/utils/externalLink.ts b/types/requests/utils/tempPageLink.ts similarity index 52% rename from types/requests/utils/externalLink.ts rename to types/requests/utils/tempPageLink.ts index 71a10bc17..0230fa8be 100644 --- a/types/requests/utils/externalLink.ts +++ b/types/requests/utils/tempPageLink.ts @@ -1,12 +1,14 @@ +import { Lang } from "@/types/lang" import type { EmbedEnum } from "./embeds" import type { Typename } from "./typename" -export type ExternalLink = { +export type TempPageLink = { system: { uid: string + locale: Lang } title: string url: string } -export type ExternalLinkType = Typename +export type TempPageLinkType = Typename