Merged in feat/LOY-362-promo-blocks (pull request #2880)

feat(LOY-362): add blocks

* feat(LOY-362): add blocks

* fix(LOY-362): hide RTE while waiting for CS


Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
Matilda Landström
2025-09-29 14:42:16 +00:00
parent 9e14a24ba3
commit dd44e39732
9 changed files with 248 additions and 8 deletions

View File

@@ -8,6 +8,8 @@ import { TrackingSDK } from "@scandic-hotels/tracking/TrackingSDK"
import { getPromoCampaignPage } from "@/lib/trpc/memoizedRequests"
import Blocks from "@/components/Blocks"
import ExpiredPromoCampaign from "./ExpiredPromoCampaign"
import PromoCampaignHero from "./Hero"
import PromoCampaignPageSkeleton from "./PromoCampaignPageSkeleton"
@@ -26,7 +28,7 @@ export default async function PromoCampaignPage() {
}
const { promo_campaign_page, tracking } = pageData
const { heading, subheading, enddate, promo_hero, eligibleLevels } =
const { heading, subheading, enddate, promo_hero, blocks, eligibleLevels } =
promo_campaign_page
const isCampaignExpired = enddate
@@ -44,6 +46,7 @@ export default async function PromoCampaignPage() {
subheading={subheading}
promoHero={promo_hero}
eligibleLevels={eligibleLevels}
blocks={blocks}
/>
)}
</Suspense>
@@ -57,11 +60,13 @@ function ActiveCampaignLayout({
subheading,
promoHero,
eligibleLevels,
blocks,
}: {
heading: PromoCampaignPageData["heading"]
subheading: PromoCampaignPageData["subheading"]
promoHero: PromoHero
eligibleLevels: PromoCampaignPageData["eligibleLevels"]
blocks: PromoCampaignPageData["blocks"]
}) {
return (
<div className={cx(styles.pageContainer, styles.active)}>
@@ -81,6 +86,7 @@ function ActiveCampaignLayout({
) : null}
</div>
</div>
{blocks ? <Blocks blocks={blocks} /> : null}
</div>
)
}

View File

@@ -8,6 +8,7 @@ import type { Block as DestinationCityPageBlock } from "@scandic-hotels/trpc/typ
import type { Block as DestinationCountryPageBlock } from "@scandic-hotels/trpc/types/destinationCountryPage"
import type { Block as DestinationOverviewPageBlock } from "@scandic-hotels/trpc/types/destinationOverviewPage"
import type { Block as LoyaltyPageBlock } from "@scandic-hotels/trpc/types/loyaltyPage"
import type { Block as PromoCampaignPageBlock } from "@scandic-hotels/trpc/types/promoCampaignPage"
type Blocks =
| AccountPageBlock
@@ -20,6 +21,7 @@ type Blocks =
| DestinationOverviewPageBlock
| LoyaltyPageBlock
| StartPageBlock
| PromoCampaignPageBlock
export interface BlocksProps {
blocks: Blocks[]