Merged in feat/SW-1517-booking-codes-tracking (pull request #1745)
Feat/SW-1517 booking codes tracking * feat: SW-1517 Updated tracking to inlcude booking code info * feat: SW-1517 Tracking booking codes * feat: SW-1517 booking code multiroom tracking * feat: SW-1517 booking code tracking select-hotel map view * feat: SW-1517 Updated to optional param * feat: SW-1517 Optimized with map * feat: SW-1517 Typings update * feat: SW-1517 Replaced reduce with map and join * feat: SW-1517 Updated typings Approved-by: Christian Andolf
This commit is contained in:
@@ -41,6 +41,7 @@ export default function SelectHotelContent({
|
||||
hotels,
|
||||
filterList,
|
||||
bookingCode,
|
||||
isBookingCodeRateAvailable,
|
||||
}: Omit<SelectHotelMapProps, "apiKey">) {
|
||||
const lang = useLang()
|
||||
const intl = useIntl()
|
||||
@@ -140,6 +141,16 @@ export default function SelectHotelContent({
|
||||
</Button>
|
||||
)
|
||||
|
||||
const isRegularRateAvailable = bookingCode
|
||||
? hotels.some(
|
||||
(hotel) =>
|
||||
hotel.availability.productType?.public?.rateType ===
|
||||
RateTypeEnum.Regular ||
|
||||
hotel.availability.productType?.member?.rateType ===
|
||||
RateTypeEnum.Regular
|
||||
)
|
||||
: false
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.listingContainer} ref={listingContainerRef}>
|
||||
@@ -160,7 +171,11 @@ export default function SelectHotelContent({
|
||||
filters={filterList}
|
||||
setShowSkeleton={setShowSkeleton}
|
||||
/>
|
||||
{bookingCode ? <BookingCodeFilter /> : null}
|
||||
{bookingCode &&
|
||||
isBookingCodeRateAvailable &&
|
||||
isRegularRateAvailable ? (
|
||||
<BookingCodeFilter />
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{showSkeleton ? (
|
||||
|
||||
Reference in New Issue
Block a user