feat(SW-589): Added correct breakfastMessage, also fixed some small issues

This commit is contained in:
Pontus Dreij
2024-11-18 15:22:13 +01:00
parent dc5746a902
commit 800d40a606
9 changed files with 34 additions and 16 deletions

View File

@@ -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}>

View File

@@ -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 {