feat: move room charge to top in price details modal
This commit is contained in:
committed by
Michael Zetterberg
parent
194a401a56
commit
a99e434d84
@@ -9,6 +9,7 @@ import { dt } from "@/lib/dt"
|
||||
import GuestDetails from "@/components/HotelReservation/MyStay/GuestDetails"
|
||||
import PriceType from "@/components/HotelReservation/MyStay/PriceType"
|
||||
import { hasModifiableRate } from "@/components/HotelReservation/MyStay/utils"
|
||||
import { sumPackages } from "@/components/HotelReservation/utils"
|
||||
import ImageGallery from "@/components/ImageGallery"
|
||||
import Accordion from "@/components/TempDesignSystem/Accordion"
|
||||
import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem"
|
||||
@@ -103,6 +104,14 @@ export default function BookedRoomSidePeek({
|
||||
vouchers,
|
||||
} = room
|
||||
|
||||
let totalRoomPrice = totalPrice
|
||||
// API returns negative values for totalPrice
|
||||
// on voucher bookings (╯°□°)╯︵ ┻━┻
|
||||
if (vouchers && totalRoomPrice < 0) {
|
||||
const pkgsSum = sumPackages(packages)
|
||||
totalRoomPrice = pkgsSum.price
|
||||
}
|
||||
|
||||
const fromDate = dt(checkInDate).locale(lang)
|
||||
|
||||
const galleryImages = hotelRoom
|
||||
@@ -382,7 +391,7 @@ export default function BookedRoomSidePeek({
|
||||
currencyCode={currencyCode}
|
||||
rateDefinition={rateDefinition}
|
||||
roomPoints={roomPoints}
|
||||
totalPrice={totalPrice}
|
||||
totalPrice={totalRoomPrice}
|
||||
vouchers={vouchers}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user