feat(SW-3108): Added external link option to top primary button on content/collection page
Approved-by: Matilda Landström
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
linkAndTitleSchema,
|
||||
linkConnectionRefs,
|
||||
} from "../schemas/linkConnection"
|
||||
import { internalOrExternalLinkSchema } from "../schemas/pageLinks"
|
||||
import { systemSchema } from "../schemas/system"
|
||||
|
||||
// Block schemas
|
||||
@@ -73,18 +74,6 @@ const navigationLinksSchema = z
|
||||
}))
|
||||
})
|
||||
|
||||
const topPrimaryButtonSchema = linkAndTitleSchema
|
||||
.nullable()
|
||||
.transform((data) => {
|
||||
if (!data?.link) {
|
||||
return null
|
||||
}
|
||||
return {
|
||||
url: data.link.url,
|
||||
title: data.title || data.link.title || null,
|
||||
}
|
||||
})
|
||||
|
||||
// Content Page Schema and types
|
||||
export const collectionPageSchema = z.object({
|
||||
collection_page: z.object({
|
||||
@@ -94,7 +83,7 @@ export const collectionPageSchema = z.object({
|
||||
header: z.object({
|
||||
heading: z.string(),
|
||||
preamble: z.string(),
|
||||
top_primary_button: topPrimaryButtonSchema,
|
||||
top_primary_button: internalOrExternalLinkSchema,
|
||||
navigation_links: navigationLinksSchema,
|
||||
}),
|
||||
meeting_package: z
|
||||
|
||||
Reference in New Issue
Block a user