From 0393f7b7b90b4e7217891858259bfcbe2de79091 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Mon, 30 Jun 2025 09:29:20 +0000 Subject: [PATCH] feat(SW-2270): Added hotel listing block to campaign overview page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Approved-by: Matilda Landström --- .../Blocks/CampaignHotelListing/Client.tsx | 9 +++++- .../campaignHotelListing.module.css | 5 +++ .../Blocks/CampaignHotelListing/index.tsx | 3 ++ .../CampaignOverviewPage/Blocks/index.tsx | 12 +++++++ .../Fragments/Blocks/HotelListing.graphql | 16 ++++++++++ .../CampaignOverviewPage.graphql | 2 ++ .../campaignOverviewPage/output.ts | 10 ++++++ .../schemas/blocks/hotelListing.ts | 31 +++++++++++++++++++ packages/trpc/lib/types/blocks.ts | 1 + .../lib/types/campaignOverviewPageEnum.ts | 1 + 10 files changed, 89 insertions(+), 1 deletion(-) diff --git a/apps/scandic-web/components/Blocks/CampaignHotelListing/Client.tsx b/apps/scandic-web/components/Blocks/CampaignHotelListing/Client.tsx index 92ad40b3b..d498423f2 100644 --- a/apps/scandic-web/components/Blocks/CampaignHotelListing/Client.tsx +++ b/apps/scandic-web/components/Blocks/CampaignHotelListing/Client.tsx @@ -20,6 +20,7 @@ import type { HotelDataWithUrl } from "@scandic-hotels/trpc/types/hotel" interface CampaignHotelListingClientProps { heading: string + preamble?: string | null hotels: HotelDataWithUrl[] visibleCountMobile?: 3 | 6 visibleCountDesktop?: 3 | 6 @@ -27,6 +28,7 @@ interface CampaignHotelListingClientProps { export default function CampaignHotelListingClient({ heading, + preamble, hotels, visibleCountMobile = 3, visibleCountDesktop = 6, @@ -46,7 +48,7 @@ export default function CampaignHotelListingClient({ ) // Only show the show more/less button if the length of hotels exceeds the threshold count - const showButton = hotels.length >= thresholdCount + const showButton = hotels.length > thresholdCount // Determine if we are at the stage where the user can click to show all hotels const canShowAll = @@ -93,6 +95,11 @@ export default function CampaignHotelListingClient({

{heading}

+ {preamble ? ( + +

{preamble}

+
+ ) : null}