fix(BOOK-418): Refactored StandaloneHotelCardDialog and fixed pricing issue when using redemption or booking codes
Approved-by: Bianca Widstam
This commit is contained in:
+11
-5
@@ -5,12 +5,13 @@ import {
|
||||
} from '@vis.gl/react-google-maps'
|
||||
import { useMediaQuery } from 'usehooks-ts'
|
||||
|
||||
import { HotelPin } from './HotelPin'
|
||||
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
|
||||
import { Lang } from '@scandic-hotels/common/constants/language'
|
||||
import { useIntl } from 'react-intl'
|
||||
import { StandaloneHotelCardDialog } from '../../../HotelCard/HotelDialogCard/StandaloneHotelCardDialog'
|
||||
import type { HotelPin as HotelPinType } from '../../types'
|
||||
import styles from './hotelListingMapContent.module.css'
|
||||
import { StandaloneHotelCardDialog } from '../../../HotelCard/HotelDialogCard/StandaloneHotelCardDialog'
|
||||
import { Lang } from '@scandic-hotels/common/constants/language'
|
||||
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
|
||||
import { HotelPin } from './HotelPin'
|
||||
|
||||
export type HotelListingMapContentProps = {
|
||||
hotelPins: HotelPinType[]
|
||||
@@ -36,6 +37,7 @@ export function HotelListingMapContent({
|
||||
onClickHotel,
|
||||
pointsCurrency,
|
||||
}: HotelListingMapContentProps) {
|
||||
const intl = useIntl()
|
||||
const isDesktop = useMediaQuery('(min-width: 900px)')
|
||||
|
||||
const toggleActiveHotelPin = (
|
||||
@@ -62,6 +64,10 @@ export function HotelListingMapContent({
|
||||
pin.chequePrice?.numberOfCheques ??
|
||||
null
|
||||
|
||||
const pinCurrency = pin.redemptionPrice
|
||||
? intl.formatMessage({ defaultMessage: 'Points' })
|
||||
: pin.currency
|
||||
|
||||
const hotelAdditionalPrice = pin.chequePrice
|
||||
? pin.chequePrice.additionalPricePerStay
|
||||
: undefined
|
||||
@@ -114,7 +120,7 @@ export function HotelListingMapContent({
|
||||
<HotelPin
|
||||
isActive={isActiveOrHovered}
|
||||
hotelPrice={hotelPrice}
|
||||
currency={pin.currency}
|
||||
currency={pinCurrency}
|
||||
hotelAdditionalPrice={hotelAdditionalPrice}
|
||||
hotelAdditionalCurrency={hotelAdditionalCurrency}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user