feat(SW-187): Added social media data and copyright label

This commit is contained in:
Pontus Dreij
2024-09-05 09:34:02 +02:00
parent 89e5d7515c
commit 144ab30bc6
17 changed files with 144 additions and 91 deletions

View File

@@ -319,6 +319,14 @@ export const validateFooterConfigSchema = z.object({
links: z.array(validateLinkItem),
})
),
social_media: z.object({
links: z.array(
z.object({
type: z.string(),
href: validateExternalLink,
})
),
}),
})
),
}),

View File

@@ -599,6 +599,7 @@ export const baseQueryRouter = router({
mainLinks: mainLinks,
appDownloads: validatedFooterData.app_downloads,
secondaryLinks: secondaryLinks,
socialMedia: validatedFooterData.social_media,
}
}),
})

View File

@@ -49,6 +49,7 @@ export function transformPageConnectionLinks(links: FooterLinkItem[]) {
title: edge.node.title || "",
url: edge.node.url || "",
openInNewTab: link.open_in_new_tab,
isExternal: false,
}))
} else if (link.link) {
return [
@@ -56,6 +57,7 @@ export function transformPageConnectionLinks(links: FooterLinkItem[]) {
title: link.link.title,
url: link.link.href,
openInNewTab: link.open_in_new_tab,
isExternal: true,
},
]
}