Merged in feat/book-425-optimize-campaign-rate-card (pull request #3015)
Feat/book 425 optimize campaign rate card * feat(BOOK-425): design updates to RateCard * feat(BOOK-425): design updates to campaign BookingCodeChip * feat(BOOK-425): fixed breakfast message & booking code chips on select rate and enter detailss * feat(BOOK-425): fixed booking code chip on Booking Confirmation page * fixed draft comments * fixed more comments * feat(BOOK-425): removed fixed height from RateCard banner * fixed another variable comment * fixed more pr comments * fixed more pr comments * updated ratecard campaign standard rate title color * removed deconstructed props Approved-by: Bianca Widstam Approved-by: Erik Tiekstra
This commit is contained in:
@@ -4,6 +4,7 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { longDateFormat } from "@scandic-hotels/common/constants/dateFormats"
|
||||
import { dt } from "@scandic-hotels/common/dt"
|
||||
import { BookingCodeChip } from "@scandic-hotels/design-system/BookingCodeChip"
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
@@ -18,13 +19,19 @@ import styles from "./receipt.module.css"
|
||||
export function Receipt() {
|
||||
const lang = useLang()
|
||||
const intl = useIntl()
|
||||
const { rooms, fromDate, toDate } = useBookingConfirmationStore((state) => ({
|
||||
rooms: state.rooms,
|
||||
fromDate: state.fromDate,
|
||||
toDate: state.toDate,
|
||||
}))
|
||||
const { rooms, fromDate, toDate, bookingCode } = useBookingConfirmationStore(
|
||||
(state) => ({
|
||||
rooms: state.rooms,
|
||||
fromDate: state.fromDate,
|
||||
toDate: state.toDate,
|
||||
bookingCode: state.bookingCode,
|
||||
})
|
||||
)
|
||||
|
||||
const totalNights = dt(toDate).diff(fromDate, "days")
|
||||
const isCampaignRate = rooms.every(
|
||||
(room) => room?.rateDefinition.isCampaignRate
|
||||
)
|
||||
|
||||
const nights = intl.formatMessage(
|
||||
{
|
||||
@@ -67,10 +74,21 @@ export function Receipt() {
|
||||
room={room}
|
||||
roomNumber={idx + 1}
|
||||
roomCount={rooms.length}
|
||||
showBookingCodeChip={
|
||||
rooms.length !== 1 &&
|
||||
(room.rateDefinition.isCampaignRate || !!bookingCode)
|
||||
}
|
||||
/>
|
||||
))}
|
||||
|
||||
<TotalPrice />
|
||||
{rooms.length === 1 && (isCampaignRate || !!bookingCode) && (
|
||||
<BookingCodeChip
|
||||
isCampaign={isCampaignRate}
|
||||
bookingCode={bookingCode}
|
||||
alignCenter
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user