Merged in fix/SW-3021-vouchers (pull request #2719)
fix(SW-3021): add pluralization support for vouchers * fix(SW-3021): add pluralization support for vouchers Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { cx } from "class-variance-authority"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
||||
import { Button } from "@scandic-hotels/design-system/Button"
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
@@ -16,8 +17,6 @@ import Breakfast from "./Breakfast"
|
||||
|
||||
import styles from "./room.module.css"
|
||||
|
||||
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
|
||||
import type { Room as RoomType } from "@/types/stores/enter-details"
|
||||
|
||||
interface RoomProps {
|
||||
@@ -114,14 +113,13 @@ export default function Room({
|
||||
)
|
||||
|
||||
let currency: string = room.roomPrice.perStay.local.currency
|
||||
const voucherCurrency = intl.formatMessage({ defaultMessage: "Voucher" })
|
||||
const isVoucher = "voucher" in room.roomRate
|
||||
if (isVoucher) {
|
||||
currency = voucherCurrency
|
||||
currency = CurrencyEnum.Voucher
|
||||
price = formatPrice(
|
||||
intl,
|
||||
room.roomPrice.perStay.local.price,
|
||||
voucherCurrency,
|
||||
currency,
|
||||
room.roomPrice.perStay.local.additionalPrice,
|
||||
room.roomPrice.perStay.local.additionalPriceCurrency
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user