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:
@@ -3,34 +3,37 @@ import { useIntl } from "react-intl"
|
||||
import { RoomPrice } from "../../HotelCard/RoomPrice"
|
||||
import { Typography } from "../../Typography"
|
||||
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import styles from "./hotelPointsRow.module.css"
|
||||
import { PointType } from "@scandic-hotels/common/constants/pointType"
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import { getCurrencyText } from "../../currency-utils"
|
||||
|
||||
export type PointsRowProps = {
|
||||
pointsPerStay: number
|
||||
additionalPricePerStay?: number
|
||||
additionalPriceCurrency?: string
|
||||
pointsCurrency?: CurrencyEnum
|
||||
pointsType: PointType | null
|
||||
}
|
||||
export function HotelPointsRow({
|
||||
pointsPerStay,
|
||||
additionalPricePerStay,
|
||||
additionalPriceCurrency,
|
||||
pointsCurrency,
|
||||
pointsType,
|
||||
}: PointsRowProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
const currency = getCurrencyText(
|
||||
intl,
|
||||
CurrencyEnum.POINTS,
|
||||
pointsPerStay,
|
||||
pointsType
|
||||
)
|
||||
|
||||
return (
|
||||
<RoomPrice
|
||||
className={styles.roomPrice}
|
||||
price={pointsPerStay}
|
||||
currency={
|
||||
pointsCurrency ??
|
||||
intl.formatMessage({
|
||||
id: "common.points",
|
||||
defaultMessage: "Points",
|
||||
})
|
||||
}
|
||||
currency={currency}
|
||||
includePerNight={false}
|
||||
>
|
||||
{additionalPricePerStay ? (
|
||||
|
||||
Reference in New Issue
Block a user