feat(SW-1717): rewrite select-rate to show all variants of rate-cards
This commit is contained in:
committed by
Michael Zetterberg
parent
adde77eaa9
commit
ebaea78fb3
@@ -47,9 +47,9 @@ export default function PriceDetails({
|
||||
|
||||
const totalPrice = isBreakfast
|
||||
? breakfastData!.priceAdult * breakfastData!.nrOfAdults +
|
||||
breakfastData!.priceChild * breakfastData!.nrOfPayingChildren
|
||||
breakfastData!.priceChild * breakfastData!.nrOfPayingChildren
|
||||
: quantityWithCard && selectedAncillary
|
||||
? selectedAncillary.price.totalPrice * quantityWithCard
|
||||
? selectedAncillary.price.total * quantityWithCard
|
||||
: null
|
||||
|
||||
const totalPoints =
|
||||
@@ -101,15 +101,15 @@ export default function PriceDetails({
|
||||
const items = isBreakfast
|
||||
? getBreakfastItems(selectedAncillary, breakfastData)
|
||||
: [
|
||||
{
|
||||
title: selectedAncillary.title,
|
||||
totalPrice: selectedAncillary.price.totalPrice,
|
||||
currency: selectedAncillary.price.currency,
|
||||
points: selectedAncillary.points,
|
||||
quantityWithCard,
|
||||
quantityWithPoints,
|
||||
},
|
||||
]
|
||||
{
|
||||
title: selectedAncillary.title,
|
||||
totalPrice: selectedAncillary.price.total,
|
||||
currency: selectedAncillary.price.currency,
|
||||
points: selectedAncillary.points,
|
||||
quantityWithCard,
|
||||
quantityWithPoints,
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useEffect } from "react"
|
||||
import { useFormContext } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
@@ -117,7 +116,7 @@ function BreakfastInfo() {
|
||||
<Alert
|
||||
type={AlertTypeEnum.Info}
|
||||
text={intl.formatMessage({
|
||||
id: "Breakfast can only be added for the entire duration of the stay
and for all guests.",
|
||||
id: "Breakfast can only be added for the entire duration of the stay and for all guests.",
|
||||
})}
|
||||
/>
|
||||
{(breakfastData.nrOfPayingChildren > 0 ||
|
||||
|
||||
@@ -212,10 +212,10 @@ export default function AddAncillaryFlowModal({
|
||||
if (booking.confirmationNumber) {
|
||||
const card = savedCreditCard
|
||||
? {
|
||||
alias: savedCreditCard.alias,
|
||||
expiryDate: savedCreditCard.expirationDate,
|
||||
cardType: savedCreditCard.cardType,
|
||||
}
|
||||
alias: savedCreditCard.alias,
|
||||
expiryDate: savedCreditCard.expirationDate,
|
||||
cardType: savedCreditCard.cardType,
|
||||
}
|
||||
: undefined
|
||||
guaranteeBooking.mutate({
|
||||
confirmationNumber: booking.confirmationNumber,
|
||||
@@ -313,7 +313,7 @@ export default function AddAncillaryFlowModal({
|
||||
) : (
|
||||
formatPrice(
|
||||
intl,
|
||||
selectedAncillary.price.totalPrice,
|
||||
selectedAncillary.price.total,
|
||||
selectedAncillary.price.currency
|
||||
)
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user