feat(SW-186): implemented queries and typings for menu inside header query

This commit is contained in:
Erik Tiekstra
2024-08-27 12:44:50 +02:00
parent 99c0d7976f
commit d5aa2c9415
6 changed files with 130 additions and 50 deletions

View File

@@ -14,12 +14,13 @@ export function makeLinkObjectFromInternalExternalLink(
const isExternalLink = data.is_external_link && data.external_link.href
const isOriginalLink = linkConnectionNode?.web?.original_url
const externalLink = data.external_link
const href = isExternalLink
? externalLink.href
: linkConnectionNode?.web?.original_url ||
removeMultipleSlashes(
`/${linkConnectionNode.system.locale}/${linkConnectionNode.url}`
)
const href =
isExternalLink || !linkConnectionNode
? externalLink.href
: linkConnectionNode.web?.original_url ||
removeMultipleSlashes(
`/${linkConnectionNode.system.locale}/${linkConnectionNode.url}`
)
const title = isExternalLink ? externalLink.title : data.page_link.link_title
return {