fix: always use totalPrice to display roomCharge
This commit is contained in:
@@ -48,13 +48,13 @@ export default function SummaryUI({
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
|
||||
const diff = dt(booking.toDate).diff(booking.fromDate, "days")
|
||||
const nights = dt(booking.toDate).diff(booking.fromDate, "days")
|
||||
|
||||
const nights = intl.formatMessage(
|
||||
const nightsMsg = intl.formatMessage(
|
||||
{
|
||||
defaultMessage: "{totalNights, plural, one {# night} other {# nights}}",
|
||||
},
|
||||
{ totalNights: diff }
|
||||
{ totalNights: nights }
|
||||
)
|
||||
|
||||
function handleToggleSummary() {
|
||||
@@ -95,7 +95,7 @@ export default function SummaryUI({
|
||||
? totalPrice.requested.currency === totalPrice.local.currency
|
||||
: false
|
||||
|
||||
const priceDetailsRooms = mapToPrice(rooms, isMember)
|
||||
const priceDetailsRooms = mapToPrice(rooms, isMember, nights)
|
||||
|
||||
return (
|
||||
<section className={styles.summary}>
|
||||
@@ -113,7 +113,7 @@ export default function SummaryUI({
|
||||
size={15}
|
||||
/>
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
{dt(booking.toDate).locale(lang).format("ddd, D MMM")} ({nights})
|
||||
{dt(booking.toDate).locale(lang).format("ddd, D MMM")} ({nightsMsg})
|
||||
</Body>
|
||||
<Button
|
||||
onPress={handleToggleSummary}
|
||||
@@ -399,7 +399,7 @@ export default function SummaryUI({
|
||||
<Body color="uiTextHighContrast">
|
||||
{formatPrice(
|
||||
intl,
|
||||
room.breakfast.localPrice.price * adults * diff,
|
||||
room.breakfast.localPrice.price * adults * nights,
|
||||
room.breakfast.localPrice.currency
|
||||
)}
|
||||
</Body>
|
||||
|
||||
Reference in New Issue
Block a user