feat(SW-2470): render correct terms on Enter details
This commit is contained in:
@@ -186,6 +186,13 @@ export default function SummaryUI({
|
||||
room.roomPrice.perStay.local.currency
|
||||
)
|
||||
|
||||
let rateDetails = room.rateDetails
|
||||
if (room.memberRateDetails) {
|
||||
if (isMember || room.guest.join) {
|
||||
rateDetails = room.memberRateDetails
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment key={idx}>
|
||||
<div
|
||||
@@ -229,49 +236,52 @@ export default function SummaryUI({
|
||||
<Caption color="uiTextMediumContrast">
|
||||
{room.cancellationText}
|
||||
</Caption>
|
||||
<Modal
|
||||
trigger={
|
||||
<Button
|
||||
variant="Text"
|
||||
typography="Body/Supporting text (caption)/smBold"
|
||||
wrapping={false}
|
||||
>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Rate details",
|
||||
{rateDetails ? (
|
||||
<Modal
|
||||
trigger={
|
||||
<Button
|
||||
variant="Text"
|
||||
typography="Body/Supporting text (caption)/smBold"
|
||||
wrapping={false}
|
||||
>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Rate details",
|
||||
})}
|
||||
<MaterialIcon
|
||||
icon="chevron_right"
|
||||
size={20}
|
||||
color="CurrentColor"
|
||||
/>
|
||||
</Button>
|
||||
}
|
||||
title={
|
||||
room.rateTitle ? room.rateTitle : room.cancellationText
|
||||
}
|
||||
subtitle={
|
||||
room.rateTitle ? room.cancellationText : undefined
|
||||
}
|
||||
>
|
||||
<div className={styles.terms}>
|
||||
{rateDetails.map((info) => {
|
||||
return (
|
||||
<Body
|
||||
key={info}
|
||||
color="uiTextHighContrast"
|
||||
className={styles.termsText}
|
||||
>
|
||||
<MaterialIcon
|
||||
icon="check"
|
||||
color="Icon/Feedback/Success"
|
||||
size={20}
|
||||
className={styles.termsIcon}
|
||||
/>
|
||||
{info}
|
||||
</Body>
|
||||
)
|
||||
})}
|
||||
<MaterialIcon
|
||||
icon="chevron_right"
|
||||
size={20}
|
||||
color="CurrentColor"
|
||||
/>
|
||||
</Button>
|
||||
}
|
||||
title={
|
||||
room.rateTitle ? room.rateTitle : room.cancellationText
|
||||
}
|
||||
subtitle={room.rateTitle ? room.cancellationText : undefined}
|
||||
>
|
||||
<div className={styles.terms}>
|
||||
{room.rateDetails?.map((info) => {
|
||||
debugger
|
||||
return (
|
||||
<Body
|
||||
key={info}
|
||||
color="uiTextHighContrast"
|
||||
className={styles.termsText}
|
||||
>
|
||||
<MaterialIcon
|
||||
icon="check"
|
||||
color="Icon/Feedback/Success"
|
||||
size={20}
|
||||
className={styles.termsIcon}
|
||||
/>
|
||||
{info}
|
||||
</Body>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</div>
|
||||
{room.roomFeatures
|
||||
? room.roomFeatures.map((feature) => (
|
||||
|
||||
@@ -42,6 +42,7 @@ export default function EnterDetailsProvider({
|
||||
breakfastIncluded: !!room.breakfastIncluded,
|
||||
cancellationText: room.cancellationText,
|
||||
rateDetails: room.rateDetails,
|
||||
memberRateDetails: room.memberRateDetails,
|
||||
rateTitle: room.rateTitle,
|
||||
roomFeatures: room.packages,
|
||||
roomRate: room.roomRate,
|
||||
@@ -56,6 +57,7 @@ export default function EnterDetailsProvider({
|
||||
}
|
||||
: undefined,
|
||||
mustBeGuaranteed: room.mustBeGuaranteed,
|
||||
memberMustBeGuaranteed: room.memberMustBeGuaranteed,
|
||||
isFlexRate: room.isFlexRate,
|
||||
})),
|
||||
vat,
|
||||
|
||||
@@ -231,7 +231,7 @@ export const hotelQueryRouter = router({
|
||||
cancellationText: rateDefinition.cancellationText,
|
||||
isAvailable: selectedRoom.status === AvailabilityEnum.Available,
|
||||
isFlexRate: product.rate === RateEnum.flex,
|
||||
memberMustBeGuaranteed: !!memberRateDefinition?.mustBeGuaranteed,
|
||||
memberMustBeGuaranteed: memberRateDefinition?.mustBeGuaranteed,
|
||||
mustBeGuaranteed: rateDefinition.mustBeGuaranteed,
|
||||
packages: room.packages.filter((pkg) =>
|
||||
selectedPackages?.includes(pkg.code)
|
||||
@@ -239,6 +239,7 @@ export const hotelQueryRouter = router({
|
||||
rate: product.rate,
|
||||
rateDefinitionTitle: rateDefinition.title,
|
||||
rateDetails: rateDefinition.generalTerms,
|
||||
memberRateDetails: memberRateDefinition?.generalTerms,
|
||||
// Send rate Title when it is a booking code rate
|
||||
rateTitle:
|
||||
rateDefinition.rateType !== RateTypeEnum.Regular
|
||||
|
||||
@@ -14,6 +14,7 @@ export interface Room {
|
||||
rate: RateEnum
|
||||
rateDefinitionTitle: string
|
||||
rateDetails: string[]
|
||||
memberRateDetails?: string[]
|
||||
rateTitle?: string
|
||||
rateType: string
|
||||
roomRate: RoomRate
|
||||
|
||||
@@ -31,13 +31,14 @@ export interface InitialRoomData {
|
||||
isAvailable: boolean
|
||||
isFlexRate: boolean
|
||||
mustBeGuaranteed: boolean
|
||||
memberMustBeGuaranteed?: boolean
|
||||
rateDetails: string[] | undefined
|
||||
memberRateDetails?: string[]
|
||||
rateTitle?: string
|
||||
roomFeatures: Packages | null
|
||||
roomRate: RoomRate
|
||||
roomType: string
|
||||
roomTypeCode: string
|
||||
memberMustBeGuaranteed?: boolean
|
||||
}
|
||||
|
||||
export type RoomStep = {
|
||||
|
||||
Reference in New Issue
Block a user