Merged in feat/BOOK-426-add-campaign-tag-select-hotel (pull request #3023)

Feat/BOOK-426 add campaign tag select hotel

* feat(BOOK-426): introduce campaign tag on select hotel card

* feat(BOOK-426): remove redundant tags

* feat(BOOK-426): fix comments, change to typography

* feat(BOOK-426): fix comments, update to cx


Approved-by: Erik Tiekstra
Approved-by: Matilda Landström
This commit is contained in:
Bianca Widstam
2025-10-29 14:10:12 +00:00
parent 5e81ec0eaf
commit ed833e714b
5 changed files with 153 additions and 69 deletions

View File

@@ -4,6 +4,7 @@ import { useRouter, useSearchParams } from "next/navigation"
import { useEffect, useMemo, useRef } from "react"
import { useIntl } from "react-intl"
import { RateTypeEnum } from "@scandic-hotels/common/constants/rateType"
import {
alternativeHotelsMap,
selectHotelMap,
@@ -82,6 +83,18 @@ export default function HotelCardListing({
isBookingCodeRateAvailable &&
activeCodeFilter === BookingCodeFilterEnum.Discounted
const isCampaignWithBookingCode =
!!bookingCode &&
hotelData
.filter((hotel) => hotel.availability.bookingCode)
.every(
(hotel) =>
hotel.availability.productType?.public?.rateType ===
RateTypeEnum.PublicPromotion ||
hotel.availability.productType?.member?.rateType ===
RateTypeEnum.PublicPromotion
)
const unfilteredHotelCount = showOnlyBookingCodeRates
? hotelData.filter((hotel) => hotel.availability.bookingCode).length
: hotelData.length
@@ -233,6 +246,7 @@ export default function HotelCardListing({
}
type={type}
bookingCode={bookingCode}
isCampaignWithBookingCode={isCampaignWithBookingCode}
isAlternative={isAlternative}
/>
</div>