Merged in feat/SW-589-breakfast-copy-select-rate (pull request #921)
feat(SW-589): Added correct breakfastMessage, also fixed some small issues Approved-by: Niclas Edenvin
This commit is contained in:
@@ -54,9 +54,23 @@ export default function RoomCard({
|
||||
: undefined
|
||||
}
|
||||
|
||||
function getPriceInformationForRate(rate: RateDefinition | undefined) {
|
||||
function getRateDefinitionForRate(rate: RateDefinition | undefined) {
|
||||
return rateDefinitions.find((def) => def.rateCode === rate?.rateCode)
|
||||
?.generalTerms
|
||||
}
|
||||
|
||||
const getBreakfastMessage = (rate: RateDefinition | undefined) => {
|
||||
const breakfastIncluded = getRateDefinitionForRate(rate)?.breakfastIncluded
|
||||
|
||||
switch (breakfastIncluded) {
|
||||
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 =
|
||||
@@ -168,9 +182,7 @@ export default function RoomCard({
|
||||
</div>
|
||||
<div className={styles.container}>
|
||||
<Caption color="uiTextHighContrast" type="bold">
|
||||
{intl.formatMessage({
|
||||
id: "Breakfast selection in next step.",
|
||||
})}
|
||||
{getBreakfastMessage(rates.flexRate)}
|
||||
</Caption>
|
||||
{roomConfiguration.status === "NotAvailable" ? (
|
||||
<div className={styles.noRoomsContainer}>
|
||||
@@ -192,7 +204,7 @@ export default function RoomCard({
|
||||
value={key.toLowerCase()}
|
||||
paymentTerm={key === "flexRate" ? payLater : payNow}
|
||||
product={findProductForRate(rate)}
|
||||
priceInformation={getPriceInformationForRate(rate)}
|
||||
priceInformation={getRateDefinitionForRate(rate)?.generalTerms}
|
||||
handleSelectRate={handleSelectRate}
|
||||
roomType={roomConfiguration.roomType}
|
||||
roomTypeCode={roomConfiguration.roomTypeCode}
|
||||
|
||||
@@ -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