feat(SW-2134): Added support for images inside accordions
Approved-by: Matilda Landström
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#import "../Image.graphql"
|
||||
|
||||
#import "../PageLink/AccountPageLink.graphql"
|
||||
#import "../PageLink/CollectionPageLink.graphql"
|
||||
#import "../PageLink/ContentPageLink.graphql"
|
||||
@@ -31,6 +33,7 @@ fragment AccordionBlock on Accordion {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...AccountPageLink
|
||||
...CollectionPageLink
|
||||
...ContentPageLink
|
||||
@@ -57,6 +60,7 @@ fragment GlobalAccordionBlock on GlobalAccordion {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...AccountPageLink
|
||||
...CollectionPageLink
|
||||
...ContentPageLink
|
||||
@@ -109,6 +113,7 @@ fragment SpecificAccordion_ContentPage on ContentPageBlocksAccordionBlockAccordi
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...AccountPageLink
|
||||
...CollectionPageLink
|
||||
...ContentPageLink
|
||||
@@ -209,6 +214,7 @@ fragment SpecificAccordion_DestinationCityPage on DestinationCityPageBlocksAccor
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...AccountPageLink
|
||||
...CollectionPageLink
|
||||
...ContentPageLink
|
||||
@@ -309,6 +315,7 @@ fragment SpecificAccordion_DestinationCountryPage on DestinationCountryPageBlock
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...AccountPageLink
|
||||
...CollectionPageLink
|
||||
...ContentPageLink
|
||||
|
||||
@@ -5,9 +5,12 @@ import {
|
||||
linkUnionSchema,
|
||||
transformPageLink,
|
||||
} from "../pageLinks"
|
||||
import { imageSchema } from "./image"
|
||||
|
||||
import { BlocksEnums } from "@/types/enums/blocks"
|
||||
|
||||
export const embeddedContentSchema = z.union([linkUnionSchema, imageSchema])
|
||||
|
||||
export const accordionItemsSchema = z.array(
|
||||
z.object({
|
||||
question: z.string(),
|
||||
@@ -16,7 +19,7 @@ export const accordionItemsSchema = z.array(
|
||||
embedded_itemsConnection: z.object({
|
||||
edges: z.array(
|
||||
z.object({
|
||||
node: linkUnionSchema.transform((data) => {
|
||||
node: embeddedContentSchema.transform((data) => {
|
||||
const link = transformPageLink(data)
|
||||
if (link) {
|
||||
return link
|
||||
|
||||
Reference in New Issue
Block a user