Merged in fix/refactor-currency-display (pull request #3434)
fix(SW-3616): Handle EuroBonus point type everywhere * Add tests to formatPrice * formatPrice * More work replacing config with api points type * More work replacing config with api points type * More fixing with currency * maybe actually fixed it * Fix MyStay * Clean up * Fix comments * Merge branch 'master' into fix/refactor-currency-display * Fix calculateTotalPrice for EB points + SF points + cash Approved-by: Joakim Jäderberg
This commit is contained in:
+5
-1
@@ -7,6 +7,7 @@ import { Typography } from "../../../../Typography"
|
||||
import HotelMarker from "../../../Markers/HotelMarker"
|
||||
|
||||
import styles from "./hotelPin.module.css"
|
||||
import { PointType } from "@scandic-hotels/common/constants/pointType"
|
||||
|
||||
interface HotelPinProps {
|
||||
isActive: boolean
|
||||
@@ -14,6 +15,7 @@ interface HotelPinProps {
|
||||
currency: string
|
||||
hotelAdditionalPrice?: number
|
||||
hotelAdditionalCurrency?: string
|
||||
pointsType?: PointType | null
|
||||
}
|
||||
const NOT_AVAILABLE = "-"
|
||||
export function HotelPin({
|
||||
@@ -22,6 +24,7 @@ export function HotelPin({
|
||||
currency,
|
||||
hotelAdditionalPrice,
|
||||
hotelAdditionalCurrency,
|
||||
pointsType,
|
||||
}: HotelPinProps) {
|
||||
const intl = useIntl()
|
||||
const isNotAvailable = !hotelPrice
|
||||
@@ -51,7 +54,8 @@ export function HotelPin({
|
||||
hotelPrice,
|
||||
currency,
|
||||
hotelAdditionalPrice,
|
||||
hotelAdditionalCurrency
|
||||
hotelAdditionalCurrency,
|
||||
pointsType
|
||||
)}
|
||||
</p>
|
||||
</Typography>
|
||||
|
||||
+7
-8
@@ -5,13 +5,13 @@ import {
|
||||
} from "@vis.gl/react-google-maps"
|
||||
import { useMediaQuery } from "usehooks-ts"
|
||||
|
||||
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 { HotelPin } from "./HotelPin"
|
||||
import { getCurrencyText } from "../../../currency-utils"
|
||||
|
||||
export type HotelListingMapContentProps = {
|
||||
hotelPins: HotelPinType[]
|
||||
@@ -19,7 +19,6 @@ export type HotelListingMapContentProps = {
|
||||
hoveredHotel?: string | null
|
||||
lang: Lang
|
||||
isUserLoggedIn: boolean
|
||||
pointsCurrency?: CurrencyEnum
|
||||
onClickHotel?: (hotelId: string) => void
|
||||
setActiveHotel?: (args: { hotelName: string; hotelId: string } | null) => void
|
||||
setHoveredHotel?: (
|
||||
@@ -35,7 +34,6 @@ export function HotelListingMapContent({
|
||||
setHoveredHotel,
|
||||
lang,
|
||||
onClickHotel,
|
||||
pointsCurrency,
|
||||
}: HotelListingMapContentProps) {
|
||||
const intl = useIntl()
|
||||
const isDesktop = useMediaQuery("(min-width: 900px)")
|
||||
@@ -65,10 +63,12 @@ export function HotelListingMapContent({
|
||||
null
|
||||
|
||||
const pinCurrency = pin.redemptionPrice
|
||||
? intl.formatMessage({
|
||||
id: "common.points",
|
||||
defaultMessage: "Points",
|
||||
})
|
||||
? getCurrencyText(
|
||||
intl,
|
||||
pin.currency,
|
||||
pin.redemptionPrice,
|
||||
pin.pointsType
|
||||
)
|
||||
: pin.currency
|
||||
|
||||
const hotelAdditionalPrice = pin.chequePrice
|
||||
@@ -116,7 +116,6 @@ export function HotelListingMapContent({
|
||||
onClick={() => {
|
||||
onClickHotel?.(pin.operaId)
|
||||
}}
|
||||
pointsCurrency={pointsCurrency}
|
||||
/>
|
||||
</InfoWindow>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user