feat: add SoonestStays

This commit is contained in:
Arvid Norlin
2024-04-22 13:34:57 +02:00
parent fc28e09df5
commit dff21b33cd
21 changed files with 235 additions and 107 deletions

View File

@@ -14,6 +14,7 @@ import NextLevelBenefitsBlock from "@/components/MyPages/Blocks/Benefits/NextLev
import Overview from "@/components/MyPages/Blocks/Overview"
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
import UpcomingStays from "@/components/MyPages/Blocks/Stays/Upcoming"
import SoonestStays from "@/components/MyPages/Blocks/Stays/Soonest"
import { renderOptions } from "@/components/JsonToHtml/renderOptions"
function DynamicComponent({
@@ -27,7 +28,8 @@ function DynamicComponent({
}) {
const componentProps = {
title: content.title,
preamble: content.preamble,
// TODO: rename preamble to subtitle in Contentstack
subtitle: content.preamble,
link: content.link.linkConnection.edges.length
? {
href: content.link.linkConnection.edges[0].node.url,
@@ -40,22 +42,14 @@ function DynamicComponent({
return <Overview user={user} />
case DynamicContentComponents.previous_stays:
return null
case DynamicContentComponents.soonest_stays:
return <SoonestStays lang={lang} {...componentProps} />
case DynamicContentComponents.upcoming_stays:
return <UpcomingStays lang={lang} {...componentProps} />
case DynamicContentComponents.current_benefits:
return (
<CurrentBenefitsBlock
title={content.title}
preamble={content.preamble}
/>
)
return <CurrentBenefitsBlock {...componentProps} />
case DynamicContentComponents.next_benefits:
return (
<NextLevelBenefitsBlock
title={content.title}
preamble={content.preamble}
/>
)
return <NextLevelBenefitsBlock {...componentProps} />
default:
return null
}
@@ -94,7 +88,6 @@ export default function Content({
/>
)
case ContentEntries.AccountPageContentTextContent:
console.log({ item })
return (
<JsonToHtml
embeds={[]}