Merged in feat/SW-1584-destination-content-blocks (pull request #1278)
Feat/SW-1584 destination content blocks * feat(SW-1584): Added accordion and content blocks to destination city pages * feat(SW-1584): Added accordion and content blocks to destination country pages Approved-by: Matilda Landström
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"header"
|
"header"
|
||||||
"sidebar"
|
"sidebar"
|
||||||
"mainSection";
|
"mainContent";
|
||||||
width: 100%;
|
width: 100%;
|
||||||
gap: var(--Spacing-x4);
|
gap: var(--Spacing-x4);
|
||||||
}
|
}
|
||||||
@@ -13,8 +13,10 @@
|
|||||||
grid-area: header;
|
grid-area: header;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mainSection {
|
.mainContent {
|
||||||
grid-area: mainSection;
|
grid-area: mainContent;
|
||||||
|
display: grid;
|
||||||
|
gap: var(--Spacing-x6);
|
||||||
padding-bottom: var(--Spacing-x7);
|
padding-bottom: var(--Spacing-x7);
|
||||||
max-width: var(--max-width-page);
|
max-width: var(--max-width-page);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -47,7 +49,11 @@
|
|||||||
.pageContainer {
|
.pageContainer {
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"header sidebar"
|
"header sidebar"
|
||||||
"mainSection sidebar";
|
"mainContent sidebar";
|
||||||
grid-template-columns: 1fr var(--map-desktop-width);
|
grid-template-columns: 1fr var(--map-desktop-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mainContent {
|
||||||
|
gap: var(--Spacing-x9);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Suspense } from "react"
|
|||||||
|
|
||||||
import { getDestinationCityPage } from "@/lib/trpc/memoizedRequests"
|
import { getDestinationCityPage } from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
|
import Blocks from "@/components/Blocks"
|
||||||
import Breadcrumbs from "@/components/Breadcrumbs"
|
import Breadcrumbs from "@/components/Breadcrumbs"
|
||||||
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
@@ -28,6 +29,7 @@ export default async function DestinationCityPage() {
|
|||||||
|
|
||||||
const { tracking, destinationCityPage, hotels } = pageData
|
const { tracking, destinationCityPage, hotels } = pageData
|
||||||
const {
|
const {
|
||||||
|
blocks,
|
||||||
images,
|
images,
|
||||||
heading,
|
heading,
|
||||||
preamble,
|
preamble,
|
||||||
@@ -51,8 +53,10 @@ export default async function DestinationCityPage() {
|
|||||||
destinationName={destination_settings.city}
|
destinationName={destination_settings.city}
|
||||||
/>
|
/>
|
||||||
</header>
|
</header>
|
||||||
<main className={styles.mainSection}>
|
<main className={styles.mainContent}>
|
||||||
<HotelListing hotels={hotels} />
|
<HotelListing hotels={hotels} />
|
||||||
|
|
||||||
|
{blocks && <Blocks blocks={blocks} />}
|
||||||
</main>
|
</main>
|
||||||
<aside className={styles.sidebar}>
|
<aside className={styles.sidebar}>
|
||||||
<SidebarContentWrapper>
|
<SidebarContentWrapper>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"header"
|
"header"
|
||||||
"sidebar"
|
"sidebar"
|
||||||
"mainSection";
|
"mainContent";
|
||||||
width: 100%;
|
width: 100%;
|
||||||
gap: var(--Spacing-x4);
|
gap: var(--Spacing-x4);
|
||||||
}
|
}
|
||||||
@@ -13,10 +13,14 @@
|
|||||||
grid-area: header;
|
grid-area: header;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mainSection {
|
.mainContent {
|
||||||
grid-area: mainSection;
|
grid-area: mainContent;
|
||||||
|
display: grid;
|
||||||
|
gap: var(--Spacing-x6);
|
||||||
padding-bottom: var(--Spacing-x7);
|
padding-bottom: var(--Spacing-x7);
|
||||||
max-width: var(--max-width-page);
|
max-width: var(--max-width-page);
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
@@ -45,7 +49,11 @@
|
|||||||
.pageContainer {
|
.pageContainer {
|
||||||
grid-template-areas:
|
grid-template-areas:
|
||||||
"header sidebar"
|
"header sidebar"
|
||||||
"mainSection sidebar";
|
"mainContent sidebar";
|
||||||
grid-template-columns: 1fr var(--map-desktop-width);
|
grid-template-columns: 1fr var(--map-desktop-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mainContent {
|
||||||
|
gap: var(--Spacing-x9);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Suspense } from "react"
|
|||||||
|
|
||||||
import { getDestinationCountryPage } from "@/lib/trpc/memoizedRequests"
|
import { getDestinationCountryPage } from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
|
import Blocks from "@/components/Blocks"
|
||||||
import Breadcrumbs from "@/components/Breadcrumbs"
|
import Breadcrumbs from "@/components/Breadcrumbs"
|
||||||
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/BreadcrumbsSkeleton"
|
||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
@@ -35,6 +36,7 @@ export default async function DestinationCountryPage() {
|
|||||||
const { tracking, destinationCountryPage, cities, translatedCountry } =
|
const { tracking, destinationCountryPage, cities, translatedCountry } =
|
||||||
pageData
|
pageData
|
||||||
const {
|
const {
|
||||||
|
blocks,
|
||||||
images,
|
images,
|
||||||
heading,
|
heading,
|
||||||
preamble,
|
preamble,
|
||||||
@@ -54,8 +56,9 @@ export default async function DestinationCountryPage() {
|
|||||||
</Suspense>
|
</Suspense>
|
||||||
<TopImages images={images} destinationName={translatedCountry} />
|
<TopImages images={images} destinationName={translatedCountry} />
|
||||||
</header>
|
</header>
|
||||||
<main className={styles.mainSection}>
|
<main className={styles.mainContent}>
|
||||||
<CityListing cities={cities} />
|
<CityListing cities={cities} />
|
||||||
|
{blocks && <Blocks blocks={blocks} />}
|
||||||
</main>
|
</main>
|
||||||
<aside className={styles.sidebar}>
|
<aside className={styles.sidebar}>
|
||||||
<SidebarContentWrapper>
|
<SidebarContentWrapper>
|
||||||
|
|||||||
@@ -79,13 +79,13 @@ fragment Accordion_ContentPage on ContentPageBlocksAccordion {
|
|||||||
title
|
title
|
||||||
accordions {
|
accordions {
|
||||||
__typename
|
__typename
|
||||||
...GlobalAccordion
|
...GlobalAccordion_ContentPage
|
||||||
...SpecificAccordion
|
...SpecificAccordion_ContentPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment GlobalAccordion on ContentPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
fragment GlobalAccordion_ContentPage on ContentPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
||||||
__typename
|
__typename
|
||||||
global_accordion {
|
global_accordion {
|
||||||
global_accordionConnection {
|
global_accordionConnection {
|
||||||
@@ -98,7 +98,7 @@ fragment GlobalAccordion on ContentPageBlocksAccordionBlockAccordionsGlobalAccor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment SpecificAccordion on ContentPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
fragment SpecificAccordion_ContentPage on ContentPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
||||||
__typename
|
__typename
|
||||||
specific_accordion {
|
specific_accordion {
|
||||||
questions {
|
questions {
|
||||||
@@ -130,13 +130,13 @@ fragment Accordion_ContentPageRefs on ContentPageBlocksAccordion {
|
|||||||
accordion {
|
accordion {
|
||||||
accordions {
|
accordions {
|
||||||
__typename
|
__typename
|
||||||
...GlobalAccordionRefs
|
...GlobalAccordion_ContentPageRefs
|
||||||
...SpecificAccordionRefs
|
...SpecificAccordion_ContentPageRefs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment GlobalAccordionRefs on ContentPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
fragment GlobalAccordion_ContentPageRefs on ContentPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
||||||
global_accordion {
|
global_accordion {
|
||||||
global_accordionConnection {
|
global_accordionConnection {
|
||||||
edges {
|
edges {
|
||||||
@@ -148,7 +148,207 @@ fragment GlobalAccordionRefs on ContentPageBlocksAccordionBlockAccordionsGlobalA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment SpecificAccordionRefs on ContentPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
fragment SpecificAccordion_ContentPageRefs on ContentPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
||||||
|
specific_accordion {
|
||||||
|
questions {
|
||||||
|
answer {
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageRef
|
||||||
|
...CollectionPageRef
|
||||||
|
...ContentPageRef
|
||||||
|
...DestinationCityPageRef
|
||||||
|
...DestinationCountryPageRef
|
||||||
|
...DestinationOverviewPageRef
|
||||||
|
...HotelPageRef
|
||||||
|
...LoyaltyPageRef
|
||||||
|
...StartPageRef
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment Accordion_DestinationCityPage on DestinationCityPageBlocksAccordion {
|
||||||
|
__typename
|
||||||
|
accordion {
|
||||||
|
title
|
||||||
|
accordions {
|
||||||
|
__typename
|
||||||
|
...GlobalAccordion_DestinationCityPage
|
||||||
|
...SpecificAccordion_DestinationCityPage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment GlobalAccordion_DestinationCityPage on DestinationCityPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
||||||
|
__typename
|
||||||
|
global_accordion {
|
||||||
|
global_accordionConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
...AccordionBlock
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment SpecificAccordion_DestinationCityPage on DestinationCityPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
||||||
|
__typename
|
||||||
|
specific_accordion {
|
||||||
|
questions {
|
||||||
|
question
|
||||||
|
answer {
|
||||||
|
json
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageLink
|
||||||
|
...CollectionPageLink
|
||||||
|
...ContentPageLink
|
||||||
|
...DestinationCityPageLink
|
||||||
|
...DestinationCountryPageLink
|
||||||
|
...DestinationOverviewPageLink
|
||||||
|
...HotelPageLink
|
||||||
|
...LoyaltyPageLink
|
||||||
|
...StartPageLink
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment Accordion_DestinationCityPageRefs on DestinationCityPageBlocksAccordion {
|
||||||
|
accordion {
|
||||||
|
accordions {
|
||||||
|
__typename
|
||||||
|
...GlobalAccordion_DestinationCityPageRefs
|
||||||
|
...SpecificAccordion_DestinationCityPageRefs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment GlobalAccordion_DestinationCityPageRefs on DestinationCityPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
||||||
|
global_accordion {
|
||||||
|
global_accordionConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
...AccordionBlockRefs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment SpecificAccordion_DestinationCityPageRefs on DestinationCityPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
||||||
|
specific_accordion {
|
||||||
|
questions {
|
||||||
|
answer {
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageRef
|
||||||
|
...CollectionPageRef
|
||||||
|
...ContentPageRef
|
||||||
|
...DestinationCityPageRef
|
||||||
|
...DestinationCountryPageRef
|
||||||
|
...DestinationOverviewPageRef
|
||||||
|
...HotelPageRef
|
||||||
|
...LoyaltyPageRef
|
||||||
|
...StartPageRef
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment Accordion_DestinationCountryPage on DestinationCountryPageBlocksAccordion {
|
||||||
|
__typename
|
||||||
|
accordion {
|
||||||
|
title
|
||||||
|
accordions {
|
||||||
|
__typename
|
||||||
|
...GlobalAccordion_DestinationCountryPage
|
||||||
|
...SpecificAccordion_DestinationCountryPage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment GlobalAccordion_DestinationCountryPage on DestinationCountryPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
||||||
|
__typename
|
||||||
|
global_accordion {
|
||||||
|
global_accordionConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
...AccordionBlock
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment SpecificAccordion_DestinationCountryPage on DestinationCountryPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
||||||
|
__typename
|
||||||
|
specific_accordion {
|
||||||
|
questions {
|
||||||
|
question
|
||||||
|
answer {
|
||||||
|
json
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageLink
|
||||||
|
...CollectionPageLink
|
||||||
|
...ContentPageLink
|
||||||
|
...DestinationCityPageLink
|
||||||
|
...DestinationCountryPageLink
|
||||||
|
...DestinationOverviewPageLink
|
||||||
|
...HotelPageLink
|
||||||
|
...LoyaltyPageLink
|
||||||
|
...StartPageLink
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment Accordion_DestinationCountryPageRefs on DestinationCountryPageBlocksAccordion {
|
||||||
|
accordion {
|
||||||
|
accordions {
|
||||||
|
__typename
|
||||||
|
...GlobalAccordion_DestinationCountryPageRefs
|
||||||
|
...SpecificAccordion_DestinationCountryPageRefs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment GlobalAccordion_DestinationCountryPageRefs on DestinationCountryPageBlocksAccordionBlockAccordionsGlobalAccordion {
|
||||||
|
global_accordion {
|
||||||
|
global_accordionConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
...AccordionBlockRefs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment SpecificAccordion_DestinationCountryPageRefs on DestinationCountryPageBlocksAccordionBlockAccordionsSpecificAccordion {
|
||||||
specific_accordion {
|
specific_accordion {
|
||||||
questions {
|
questions {
|
||||||
answer {
|
answer {
|
||||||
|
|||||||
@@ -118,3 +118,97 @@ fragment Content_LoyaltyPageRefs on LoyaltyPageBlocksContent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fragment Content_DestinationCityPage on DestinationCityPageBlocksContent {
|
||||||
|
content {
|
||||||
|
content {
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageLink
|
||||||
|
...CollectionPageLink
|
||||||
|
...ContentPageLink
|
||||||
|
...DestinationCityPageLink
|
||||||
|
...DestinationCountryPageLink
|
||||||
|
...DestinationOverviewPageLink
|
||||||
|
...HotelPageLink
|
||||||
|
...LoyaltyPageLink
|
||||||
|
...StartPageLink
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
json
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment Content_DestinationCityPageRefs on DestinationCityPageBlocksContent {
|
||||||
|
content {
|
||||||
|
content {
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageRef
|
||||||
|
...CollectionPageRef
|
||||||
|
...ContentPageRef
|
||||||
|
...DestinationCityPageRef
|
||||||
|
...DestinationCountryPageRef
|
||||||
|
...DestinationOverviewPageRef
|
||||||
|
...HotelPageRef
|
||||||
|
...LoyaltyPageRef
|
||||||
|
...StartPageRef
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment Content_DestinationCountryPage on DestinationCountryPageBlocksContent {
|
||||||
|
content {
|
||||||
|
content {
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageLink
|
||||||
|
...CollectionPageLink
|
||||||
|
...ContentPageLink
|
||||||
|
...DestinationCityPageLink
|
||||||
|
...DestinationCountryPageLink
|
||||||
|
...DestinationOverviewPageLink
|
||||||
|
...HotelPageLink
|
||||||
|
...LoyaltyPageLink
|
||||||
|
...StartPageLink
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
json
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment Content_DestinationCountryPageRefs on DestinationCountryPageBlocksContent {
|
||||||
|
content {
|
||||||
|
content {
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...AccountPageRef
|
||||||
|
...CollectionPageRef
|
||||||
|
...ContentPageRef
|
||||||
|
...DestinationCityPageRef
|
||||||
|
...DestinationCountryPageRef
|
||||||
|
...DestinationOverviewPageRef
|
||||||
|
...HotelPageRef
|
||||||
|
...LoyaltyPageRef
|
||||||
|
...StartPageRef
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
#import "../../Fragments/System.graphql"
|
#import "../../Fragments/System.graphql"
|
||||||
|
|
||||||
|
#import "../../Fragments/Blocks/Accordion.graphql"
|
||||||
|
#import "../../Fragments/Blocks/Content.graphql"
|
||||||
|
|
||||||
#import "../../Fragments/PageLink/AccountPageLink.graphql"
|
#import "../../Fragments/PageLink/AccountPageLink.graphql"
|
||||||
#import "../../Fragments/PageLink/CollectionPageLink.graphql"
|
#import "../../Fragments/PageLink/CollectionPageLink.graphql"
|
||||||
#import "../../Fragments/PageLink/ContentPageLink.graphql"
|
#import "../../Fragments/PageLink/ContentPageLink.graphql"
|
||||||
@@ -63,6 +66,11 @@ query GetDestinationCityPage($locale: String!, $uid: String!) {
|
|||||||
json
|
json
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
blocks {
|
||||||
|
__typename
|
||||||
|
...Accordion_DestinationCityPage
|
||||||
|
...Content_DestinationCityPage
|
||||||
|
}
|
||||||
system {
|
system {
|
||||||
...System
|
...System
|
||||||
created_at
|
created_at
|
||||||
@@ -96,6 +104,11 @@ query GetDestinationCityPageRefs($locale: String!, $uid: String!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
blocks {
|
||||||
|
__typename
|
||||||
|
...Accordion_DestinationCityPageRefs
|
||||||
|
...Content_DestinationCityPageRefs
|
||||||
|
}
|
||||||
system {
|
system {
|
||||||
...System
|
...System
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
#import "../../Fragments/System.graphql"
|
#import "../../Fragments/System.graphql"
|
||||||
|
|
||||||
|
#import "../../Fragments/Blocks/Accordion.graphql"
|
||||||
|
#import "../../Fragments/Blocks/Content.graphql"
|
||||||
|
|
||||||
#import "../../Fragments/PageLink/AccountPageLink.graphql"
|
#import "../../Fragments/PageLink/AccountPageLink.graphql"
|
||||||
#import "../../Fragments/PageLink/CollectionPageLink.graphql"
|
#import "../../Fragments/PageLink/CollectionPageLink.graphql"
|
||||||
#import "../../Fragments/PageLink/ContentPageLink.graphql"
|
#import "../../Fragments/PageLink/ContentPageLink.graphql"
|
||||||
@@ -58,6 +61,11 @@ query GetDestinationCountryPage($locale: String!, $uid: String!) {
|
|||||||
json
|
json
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
blocks {
|
||||||
|
__typename
|
||||||
|
...Accordion_DestinationCountryPage
|
||||||
|
...Content_DestinationCountryPage
|
||||||
|
}
|
||||||
system {
|
system {
|
||||||
...System
|
...System
|
||||||
created_at
|
created_at
|
||||||
@@ -91,6 +99,11 @@ query GetDestinationCountryPageRefs($locale: String!, $uid: String!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
blocks {
|
||||||
|
__typename
|
||||||
|
...Accordion_DestinationCountryPageRefs
|
||||||
|
...Content_DestinationCountryPageRefs
|
||||||
|
}
|
||||||
system {
|
system {
|
||||||
...System
|
...System
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
|
import { discriminatedUnionArray } from "@/lib/discriminatedUnion"
|
||||||
|
|
||||||
import { removeMultipleSlashes } from "@/utils/url"
|
import { removeMultipleSlashes } from "@/utils/url"
|
||||||
|
|
||||||
|
import {
|
||||||
|
accordionRefsSchema,
|
||||||
|
accordionSchema,
|
||||||
|
} from "../schemas/blocks/accordion"
|
||||||
|
import { contentRefsSchema, contentSchema } from "../schemas/blocks/content"
|
||||||
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
||||||
import {
|
import {
|
||||||
linkRefsUnionSchema,
|
linkRefsUnionSchema,
|
||||||
@@ -15,6 +22,7 @@ import {
|
|||||||
TrackingChannelEnum,
|
TrackingChannelEnum,
|
||||||
type TrackingSDKPageData,
|
type TrackingSDKPageData,
|
||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
|
import { DestinationCityPageEnum } from "@/types/enums/destinationCityPage"
|
||||||
|
|
||||||
export const destinationCityListDataSchema = z
|
export const destinationCityListDataSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -54,6 +62,25 @@ export const destinationCityListDataSchema = z
|
|||||||
({ all_destination_city_page }) => all_destination_city_page.items?.[0]
|
({ all_destination_city_page }) => all_destination_city_page.items?.[0]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export const destinationCityPageContent = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(DestinationCityPageEnum.ContentStack.blocks.Content),
|
||||||
|
})
|
||||||
|
.merge(contentSchema)
|
||||||
|
|
||||||
|
export const destinationCityPageAccordion = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(
|
||||||
|
DestinationCityPageEnum.ContentStack.blocks.Accordion
|
||||||
|
),
|
||||||
|
})
|
||||||
|
.merge(accordionSchema)
|
||||||
|
|
||||||
|
export const blocksSchema = z.discriminatedUnion("__typename", [
|
||||||
|
destinationCityPageAccordion,
|
||||||
|
destinationCityPageContent,
|
||||||
|
])
|
||||||
|
|
||||||
export const destinationCityPageSchema = z
|
export const destinationCityPageSchema = z
|
||||||
.object({
|
.object({
|
||||||
destination_city_page: z.object({
|
destination_city_page: z.object({
|
||||||
@@ -123,6 +150,7 @@ export const destinationCityPageSchema = z
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
blocks: discriminatedUnionArray(blocksSchema.options).nullable(),
|
||||||
system: systemSchema.merge(
|
system: systemSchema.merge(
|
||||||
z.object({
|
z.object({
|
||||||
created_at: z.string(),
|
created_at: z.string(),
|
||||||
@@ -158,6 +186,25 @@ export const destinationCityPageSchema = z
|
|||||||
})
|
})
|
||||||
|
|
||||||
/** REFS */
|
/** REFS */
|
||||||
|
const destinationCityPageContentRefs = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(DestinationCityPageEnum.ContentStack.blocks.Content),
|
||||||
|
})
|
||||||
|
.merge(contentRefsSchema)
|
||||||
|
|
||||||
|
const destinationCityPageAccordionRefs = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(
|
||||||
|
DestinationCityPageEnum.ContentStack.blocks.Accordion
|
||||||
|
),
|
||||||
|
})
|
||||||
|
.merge(accordionRefsSchema)
|
||||||
|
|
||||||
|
const blocksRefsSchema = z.discriminatedUnion("__typename", [
|
||||||
|
destinationCityPageAccordionRefs,
|
||||||
|
destinationCityPageContentRefs,
|
||||||
|
])
|
||||||
|
|
||||||
export const destinationCityPageRefsSchema = z.object({
|
export const destinationCityPageRefsSchema = z.object({
|
||||||
destination_city_page: z.object({
|
destination_city_page: z.object({
|
||||||
sidepeek_content: z.object({
|
sidepeek_content: z.object({
|
||||||
@@ -171,6 +218,7 @@ export const destinationCityPageRefsSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
blocks: discriminatedUnionArray(blocksRefsSchema.options).nullable(),
|
||||||
system: systemSchema,
|
system: systemSchema,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ import { getHotel } from "../../hotels/query"
|
|||||||
import { getHotelIdsByCityIdentifier } from "../../hotels/utils"
|
import { getHotelIdsByCityIdentifier } from "../../hotels/utils"
|
||||||
import { getHotelPageUrl } from "../hotelPage/utils"
|
import { getHotelPageUrl } from "../hotelPage/utils"
|
||||||
|
|
||||||
|
import { DestinationCityPageEnum } from "@/types/enums/destinationCityPage"
|
||||||
import type { HotelData } from "@/types/hotel"
|
import type { HotelData } from "@/types/hotel"
|
||||||
import type { System } from "@/types/requests/system"
|
import type { System } from "@/types/requests/system"
|
||||||
import type { GetDestinationCityPageRefsSchema } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
import type { DestinationCityPageRefs } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
||||||
import type { Lang } from "@/constants/languages"
|
import type { Lang } from "@/constants/languages"
|
||||||
|
|
||||||
export function generatePageTags(
|
export function generatePageTags(
|
||||||
validatedData: GetDestinationCityPageRefsSchema,
|
validatedData: DestinationCityPageRefs,
|
||||||
lang: Lang
|
lang: Lang
|
||||||
): string[] {
|
): string[] {
|
||||||
const connections = getConnections(validatedData)
|
const connections = getConnections(validatedData)
|
||||||
@@ -22,8 +23,29 @@ export function generatePageTags(
|
|||||||
|
|
||||||
export function getConnections({
|
export function getConnections({
|
||||||
destination_city_page,
|
destination_city_page,
|
||||||
}: GetDestinationCityPageRefsSchema) {
|
}: DestinationCityPageRefs) {
|
||||||
const connections: System["system"][] = [destination_city_page.system]
|
const connections: System["system"][] = [destination_city_page.system]
|
||||||
|
if (destination_city_page.blocks) {
|
||||||
|
destination_city_page.blocks.forEach((block) => {
|
||||||
|
switch (block.__typename) {
|
||||||
|
case DestinationCityPageEnum.ContentStack.blocks.Accordion: {
|
||||||
|
if (block.accordion.length) {
|
||||||
|
connections.push(...block.accordion)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case DestinationCityPageEnum.ContentStack.blocks.Content:
|
||||||
|
{
|
||||||
|
if (block.content.length) {
|
||||||
|
// TS has trouble infering the filtered types
|
||||||
|
// @ts-ignore
|
||||||
|
connections.push(...block.content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
if (destination_city_page.sidepeek_content) {
|
if (destination_city_page.sidepeek_content) {
|
||||||
destination_city_page.sidepeek_content.content.embedded_itemsConnection.edges.forEach(
|
destination_city_page.sidepeek_content.content.embedded_itemsConnection.edges.forEach(
|
||||||
({ node }) => {
|
({ node }) => {
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
|
import { discriminatedUnionArray } from "@/lib/discriminatedUnion"
|
||||||
|
|
||||||
|
import {
|
||||||
|
accordionRefsSchema,
|
||||||
|
accordionSchema,
|
||||||
|
} from "../schemas/blocks/accordion"
|
||||||
|
import { contentRefsSchema, contentSchema } from "../schemas/blocks/content"
|
||||||
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
||||||
import {
|
import {
|
||||||
linkRefsUnionSchema,
|
linkRefsUnionSchema,
|
||||||
@@ -14,6 +21,28 @@ import {
|
|||||||
type TrackingSDKPageData,
|
type TrackingSDKPageData,
|
||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
import { Country } from "@/types/enums/country"
|
import { Country } from "@/types/enums/country"
|
||||||
|
import { DestinationCountryPageEnum } from "@/types/enums/destinationCountryPage"
|
||||||
|
|
||||||
|
export const destinationCountryPageContent = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(
|
||||||
|
DestinationCountryPageEnum.ContentStack.blocks.Content
|
||||||
|
),
|
||||||
|
})
|
||||||
|
.merge(contentSchema)
|
||||||
|
|
||||||
|
export const destinationCountryPageAccordion = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(
|
||||||
|
DestinationCountryPageEnum.ContentStack.blocks.Accordion
|
||||||
|
),
|
||||||
|
})
|
||||||
|
.merge(accordionSchema)
|
||||||
|
|
||||||
|
export const blocksSchema = z.discriminatedUnion("__typename", [
|
||||||
|
destinationCountryPageAccordion,
|
||||||
|
destinationCountryPageContent,
|
||||||
|
])
|
||||||
|
|
||||||
export const destinationCountryPageSchema = z
|
export const destinationCountryPageSchema = z
|
||||||
.object({
|
.object({
|
||||||
@@ -57,6 +86,7 @@ export const destinationCountryPageSchema = z
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
blocks: discriminatedUnionArray(blocksSchema.options).nullable(),
|
||||||
system: systemSchema.merge(
|
system: systemSchema.merge(
|
||||||
z.object({
|
z.object({
|
||||||
created_at: z.string(),
|
created_at: z.string(),
|
||||||
@@ -91,6 +121,26 @@ export const destinationCountryPageSchema = z
|
|||||||
})
|
})
|
||||||
|
|
||||||
/** REFS */
|
/** REFS */
|
||||||
|
const destinationCountryPageContentRefs = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(
|
||||||
|
DestinationCountryPageEnum.ContentStack.blocks.Content
|
||||||
|
),
|
||||||
|
})
|
||||||
|
.merge(contentRefsSchema)
|
||||||
|
|
||||||
|
const destinationCountryPageAccordionRefs = z
|
||||||
|
.object({
|
||||||
|
__typename: z.literal(
|
||||||
|
DestinationCountryPageEnum.ContentStack.blocks.Accordion
|
||||||
|
),
|
||||||
|
})
|
||||||
|
.merge(accordionRefsSchema)
|
||||||
|
|
||||||
|
const blocksRefsSchema = z.discriminatedUnion("__typename", [
|
||||||
|
destinationCountryPageAccordionRefs,
|
||||||
|
destinationCountryPageContentRefs,
|
||||||
|
])
|
||||||
export const destinationCountryPageRefsSchema = z.object({
|
export const destinationCountryPageRefsSchema = z.object({
|
||||||
destination_country_page: z.object({
|
destination_country_page: z.object({
|
||||||
sidepeek_content: z.object({
|
sidepeek_content: z.object({
|
||||||
@@ -104,6 +154,7 @@ export const destinationCountryPageRefsSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
blocks: discriminatedUnionArray(blocksRefsSchema.options).nullable(),
|
||||||
system: systemSchema,
|
system: systemSchema,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,14 +14,15 @@ import {
|
|||||||
} from "./telemetry"
|
} from "./telemetry"
|
||||||
|
|
||||||
import { ApiCountry, type Country } from "@/types/enums/country"
|
import { ApiCountry, type Country } from "@/types/enums/country"
|
||||||
|
import { DestinationCountryPageEnum } from "@/types/enums/destinationCountryPage"
|
||||||
import type { RequestOptionsWithOutBody } from "@/types/fetch"
|
import type { RequestOptionsWithOutBody } from "@/types/fetch"
|
||||||
import type { System } from "@/types/requests/system"
|
import type { System } from "@/types/requests/system"
|
||||||
import type { GetDestinationCityListDataResponse } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
import type { GetDestinationCityListDataResponse } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
||||||
import type { GetDestinationCountryPageRefsSchema } from "@/types/trpc/routers/contentstack/destinationCountryPage"
|
import type { DestinationCountryPageRefs } from "@/types/trpc/routers/contentstack/destinationCountryPage"
|
||||||
import type { Lang } from "@/constants/languages"
|
import type { Lang } from "@/constants/languages"
|
||||||
|
|
||||||
export function generatePageTags(
|
export function generatePageTags(
|
||||||
validatedData: GetDestinationCountryPageRefsSchema,
|
validatedData: DestinationCountryPageRefs,
|
||||||
lang: Lang
|
lang: Lang
|
||||||
): string[] {
|
): string[] {
|
||||||
const connections = getConnections(validatedData)
|
const connections = getConnections(validatedData)
|
||||||
@@ -33,9 +34,29 @@ export function generatePageTags(
|
|||||||
|
|
||||||
export function getConnections({
|
export function getConnections({
|
||||||
destination_country_page,
|
destination_country_page,
|
||||||
}: GetDestinationCountryPageRefsSchema) {
|
}: DestinationCountryPageRefs) {
|
||||||
const connections: System["system"][] = [destination_country_page.system]
|
const connections: System["system"][] = [destination_country_page.system]
|
||||||
|
if (destination_country_page.blocks) {
|
||||||
|
destination_country_page.blocks.forEach((block) => {
|
||||||
|
switch (block.__typename) {
|
||||||
|
case DestinationCountryPageEnum.ContentStack.blocks.Accordion: {
|
||||||
|
if (block.accordion.length) {
|
||||||
|
connections.push(...block.accordion)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case DestinationCountryPageEnum.ContentStack.blocks.Content:
|
||||||
|
{
|
||||||
|
if (block.content.length) {
|
||||||
|
// TS has trouble infering the filtered types
|
||||||
|
// @ts-ignore
|
||||||
|
connections.push(...block.content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
if (destination_country_page.sidepeek_content) {
|
if (destination_country_page.sidepeek_content) {
|
||||||
destination_country_page.sidepeek_content.content.embedded_itemsConnection.edges.forEach(
|
destination_country_page.sidepeek_content.content.embedded_itemsConnection.edges.forEach(
|
||||||
({ node }) => {
|
({ node }) => {
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ export type Accordion = z.infer<typeof accordionSchema>
|
|||||||
enum AccordionEnum {
|
enum AccordionEnum {
|
||||||
ContentPageBlocksAccordionBlockAccordionsGlobalAccordion = "ContentPageBlocksAccordionBlockAccordionsGlobalAccordion",
|
ContentPageBlocksAccordionBlockAccordionsGlobalAccordion = "ContentPageBlocksAccordionBlockAccordionsGlobalAccordion",
|
||||||
ContentPageBlocksAccordionBlockAccordionsSpecificAccordion = "ContentPageBlocksAccordionBlockAccordionsSpecificAccordion",
|
ContentPageBlocksAccordionBlockAccordionsSpecificAccordion = "ContentPageBlocksAccordionBlockAccordionsSpecificAccordion",
|
||||||
|
DestinationCityPageBlocksAccordionBlockAccordionsGlobalAccordion = "DestinationCityPageBlocksAccordionBlockAccordionsGlobalAccordion",
|
||||||
|
DestinationCityPageBlocksAccordionBlockAccordionsSpecificAccordion = "DestinationCityPageBlocksAccordionBlockAccordionsSpecificAccordion",
|
||||||
|
DestinationCountryPageBlocksAccordionBlockAccordionsGlobalAccordion = "DestinationCountryPageBlocksAccordionBlockAccordionsGlobalAccordion",
|
||||||
|
DestinationCountryPageBlocksAccordionBlockAccordionsSpecificAccordion = "DestinationCountryPageBlocksAccordionBlockAccordionsSpecificAccordion",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const accordionSchema = z.object({
|
export const accordionSchema = z.object({
|
||||||
@@ -47,10 +51,7 @@ export const accordionSchema = z.object({
|
|||||||
title: z.string().optional().default(""),
|
title: z.string().optional().default(""),
|
||||||
accordions: z.array(
|
accordions: z.array(
|
||||||
z.object({
|
z.object({
|
||||||
__typename: z.enum([
|
__typename: z.nativeEnum(AccordionEnum),
|
||||||
AccordionEnum.ContentPageBlocksAccordionBlockAccordionsGlobalAccordion,
|
|
||||||
AccordionEnum.ContentPageBlocksAccordionBlockAccordionsSpecificAccordion,
|
|
||||||
]),
|
|
||||||
global_accordion: z
|
global_accordion: z
|
||||||
.object({
|
.object({
|
||||||
global_accordionConnection: z.object({
|
global_accordionConnection: z.object({
|
||||||
@@ -78,6 +79,8 @@ export const accordionSchema = z.object({
|
|||||||
accordions: data.accordions.flatMap((acc) => {
|
accordions: data.accordions.flatMap((acc) => {
|
||||||
switch (acc.__typename) {
|
switch (acc.__typename) {
|
||||||
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
||||||
|
case AccordionEnum.DestinationCityPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
||||||
|
case AccordionEnum.DestinationCountryPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
||||||
return (
|
return (
|
||||||
acc.global_accordion?.global_accordionConnection.edges.flatMap(
|
acc.global_accordion?.global_accordionConnection.edges.flatMap(
|
||||||
({ node: accordionConnection }) => {
|
({ node: accordionConnection }) => {
|
||||||
@@ -86,6 +89,8 @@ export const accordionSchema = z.object({
|
|||||||
) || []
|
) || []
|
||||||
)
|
)
|
||||||
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
||||||
|
case AccordionEnum.DestinationCityPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
||||||
|
case AccordionEnum.DestinationCountryPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
||||||
return acc.specific_accordion?.questions || []
|
return acc.specific_accordion?.questions || []
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -136,10 +141,7 @@ export const accordionRefsSchema = z.object({
|
|||||||
.object({
|
.object({
|
||||||
accordions: z.array(
|
accordions: z.array(
|
||||||
z.object({
|
z.object({
|
||||||
__typename: z.enum([
|
__typename: z.nativeEnum(AccordionEnum),
|
||||||
AccordionEnum.ContentPageBlocksAccordionBlockAccordionsGlobalAccordion,
|
|
||||||
AccordionEnum.ContentPageBlocksAccordionBlockAccordionsSpecificAccordion,
|
|
||||||
]),
|
|
||||||
global_accordion: z
|
global_accordion: z
|
||||||
.object({
|
.object({
|
||||||
global_accordionConnection: globalAccordionConnectionRefs,
|
global_accordionConnection: globalAccordionConnectionRefs,
|
||||||
@@ -153,6 +155,8 @@ export const accordionRefsSchema = z.object({
|
|||||||
return data.accordions.flatMap((accordion) => {
|
return data.accordions.flatMap((accordion) => {
|
||||||
switch (accordion.__typename) {
|
switch (accordion.__typename) {
|
||||||
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
||||||
|
case AccordionEnum.DestinationCityPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
||||||
|
case AccordionEnum.DestinationCountryPageBlocksAccordionBlockAccordionsGlobalAccordion:
|
||||||
return (
|
return (
|
||||||
accordion.global_accordion?.global_accordionConnection.edges.flatMap(
|
accordion.global_accordion?.global_accordionConnection.edges.flatMap(
|
||||||
({ node: accordionConnection }) => {
|
({ node: accordionConnection }) => {
|
||||||
@@ -165,6 +169,8 @@ export const accordionRefsSchema = z.object({
|
|||||||
) || []
|
) || []
|
||||||
)
|
)
|
||||||
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
case AccordionEnum.ContentPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
||||||
|
case AccordionEnum.DestinationCityPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
||||||
|
case AccordionEnum.DestinationCountryPageBlocksAccordionBlockAccordionsSpecificAccordion:
|
||||||
return (
|
return (
|
||||||
accordion.specific_accordion?.questions.flatMap((question) =>
|
accordion.specific_accordion?.questions.flatMap((question) =>
|
||||||
question.answer.embedded_itemsConnection.edges.flatMap(
|
question.answer.embedded_itemsConnection.edges.flatMap(
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import type { Block as AccountPageBlock } from "@/types/trpc/routers/contentstack/accountPage"
|
import type { Block as AccountPageBlock } from "@/types/trpc/routers/contentstack/accountPage"
|
||||||
import type { Block as CollectionPageBlock } from "@/types/trpc/routers/contentstack/collectionPage"
|
import type { Block as CollectionPageBlock } from "@/types/trpc/routers/contentstack/collectionPage"
|
||||||
import type { Block as ContentPageBlock } from "@/types/trpc/routers/contentstack/contentPage"
|
import type { Block as ContentPageBlock } from "@/types/trpc/routers/contentstack/contentPage"
|
||||||
|
import type { Block as DestinationCityPageBlock } from "@/types/trpc/routers/contentstack/destinationCityPage"
|
||||||
|
import type { Block as DestinationCountryPageBlock } from "@/types/trpc/routers/contentstack/destinationCountryPage"
|
||||||
import type { Block as LoyaltyPageBlock } from "@/types/trpc/routers/contentstack/loyaltyPage"
|
import type { Block as LoyaltyPageBlock } from "@/types/trpc/routers/contentstack/loyaltyPage"
|
||||||
import type { Block as StartPageBlock } from "@/types/trpc/routers/contentstack/startPage"
|
import type { Block as StartPageBlock } from "@/types/trpc/routers/contentstack/startPage"
|
||||||
|
|
||||||
@@ -8,6 +10,8 @@ export type Blocks =
|
|||||||
| AccountPageBlock
|
| AccountPageBlock
|
||||||
| CollectionPageBlock
|
| CollectionPageBlock
|
||||||
| ContentPageBlock
|
| ContentPageBlock
|
||||||
|
| DestinationCityPageBlock
|
||||||
|
| DestinationCountryPageBlock
|
||||||
| LoyaltyPageBlock
|
| LoyaltyPageBlock
|
||||||
| StartPageBlock
|
| StartPageBlock
|
||||||
|
|
||||||
|
|||||||
8
types/enums/destinationCityPage.ts
Normal file
8
types/enums/destinationCityPage.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export namespace DestinationCityPageEnum {
|
||||||
|
export namespace ContentStack {
|
||||||
|
export const enum blocks {
|
||||||
|
Accordion = "DestinationCityPageBlocksAccordion",
|
||||||
|
Content = "DestinationCityPageBlocksContent",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
types/enums/destinationCountryPage.ts
Normal file
8
types/enums/destinationCountryPage.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export namespace DestinationCountryPageEnum {
|
||||||
|
export namespace ContentStack {
|
||||||
|
export const enum blocks {
|
||||||
|
Accordion = "DestinationCountryPageBlocksAccordion",
|
||||||
|
Content = "DestinationCountryPageBlocksContent",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { z } from "zod"
|
import type { z } from "zod"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
blocksSchema,
|
||||||
destinationCityListDataSchema,
|
destinationCityListDataSchema,
|
||||||
destinationCityPageRefsSchema,
|
destinationCityPageRefsSchema,
|
||||||
destinationCityPageSchema,
|
destinationCityPageSchema,
|
||||||
@@ -21,6 +22,7 @@ export interface DestinationCityListData
|
|||||||
export interface DestinationCityListItem extends DestinationCityListData {
|
export interface DestinationCityListItem extends DestinationCityListData {
|
||||||
cityName: string
|
cityName: string
|
||||||
}
|
}
|
||||||
|
export type Block = z.output<typeof blocksSchema>
|
||||||
|
|
||||||
export interface GetDestinationCityPageRefsSchema
|
export interface GetDestinationCityPageRefsSchema
|
||||||
extends z.input<typeof destinationCityPageRefsSchema> {}
|
extends z.input<typeof destinationCityPageRefsSchema> {}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { z } from "zod"
|
import type { z } from "zod"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
blocksSchema,
|
||||||
destinationCountryPageRefsSchema,
|
destinationCountryPageRefsSchema,
|
||||||
destinationCountryPageSchema,
|
destinationCountryPageSchema,
|
||||||
} from "@/server/routers/contentstack/destinationCountryPage/output"
|
} from "@/server/routers/contentstack/destinationCountryPage/output"
|
||||||
@@ -11,6 +12,7 @@ interface DestinationCountryPage
|
|||||||
extends z.output<typeof destinationCountryPageSchema> {}
|
extends z.output<typeof destinationCountryPageSchema> {}
|
||||||
export type DestinationCountryPageData =
|
export type DestinationCountryPageData =
|
||||||
DestinationCountryPage["destinationCountryPage"]
|
DestinationCountryPage["destinationCountryPage"]
|
||||||
|
export type Block = z.output<typeof blocksSchema>
|
||||||
|
|
||||||
export interface GetDestinationCountryPageRefsSchema
|
export interface GetDestinationCountryPageRefsSchema
|
||||||
extends z.input<typeof destinationCountryPageRefsSchema> {}
|
extends z.input<typeof destinationCountryPageRefsSchema> {}
|
||||||
|
|||||||
Reference in New Issue
Block a user