feat(SW-589): Added correct breakfastMessage, also fixed some small issues
This commit is contained in:
@@ -59,6 +59,25 @@ export default function RoomCard({
|
||||
?.generalTerms
|
||||
}
|
||||
|
||||
function getBreakfastInformation(rate: RateDefinition | undefined) {
|
||||
return rateDefinitions.find((def) => def.rateCode === rate?.rateCode)
|
||||
?.breakfastIncluded
|
||||
}
|
||||
|
||||
const breakfastMessage = (rate: RateDefinition | undefined) => {
|
||||
const breakfastInfo = getBreakfastInformation(rate)
|
||||
switch (breakfastInfo) {
|
||||
case true:
|
||||
return intl.formatMessage({ id: "Breakfast is included." })
|
||||
case false:
|
||||
return intl.formatMessage({ id: "Breakfast selection in next step." })
|
||||
default:
|
||||
return intl.formatMessage({
|
||||
id: "Breakfast deal can be purchased at the hotel.",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const petRoomPackage =
|
||||
(selectedPackages.includes(RoomPackageCodeEnum.PET_ROOM) &&
|
||||
packages?.find((pkg) => pkg.code === RoomPackageCodeEnum.PET_ROOM)) ||
|
||||
@@ -168,9 +187,7 @@ export default function RoomCard({
|
||||
</div>
|
||||
<div className={styles.container}>
|
||||
<Caption color="uiTextHighContrast" type="bold">
|
||||
{intl.formatMessage({
|
||||
id: "Breakfast selection in next step.",
|
||||
})}
|
||||
{breakfastMessage(rates.flexRate)}
|
||||
</Caption>
|
||||
{roomConfiguration.status === "NotAvailable" ? (
|
||||
<div className={styles.noRoomsContainer}>
|
||||
|
||||
@@ -12,18 +12,7 @@
|
||||
|
||||
.card.noAvailability {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.card.noAvailability:before {
|
||||
background-color: rgba(0, 0, 0, 40%);
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.specification {
|
||||
|
||||
Reference in New Issue
Block a user