Merged in feat/SW-822-handle-breakfast-included (pull request #1138)
Feat/SW-822 handle breakfast included * feat(SW-822): Added flag for breakfast included and hide breakfast step if included * fix: check if window is defined to avoid error during SSR * fix: remove return if rate definition is not found because its expected if input is undefined Approved-by: Christel Westerberg Approved-by: Arvid Norlin
This commit is contained in:
@@ -126,7 +126,7 @@ export default async function StepPage({
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const mustBeGuaranteed = roomAvailability?.mustBeGuaranteed ?? false
|
||||
const { mustBeGuaranteed, breakfastIncluded } = roomAvailability
|
||||
|
||||
const paymentGuarantee = intl.formatMessage({
|
||||
id: "Payment Guarantee",
|
||||
@@ -191,13 +191,18 @@ export default async function StepPage({
|
||||
isMember: !!user,
|
||||
rateDetails: roomAvailability.rateDetails,
|
||||
roomType: roomAvailability.selectedRoom.roomType,
|
||||
breakfastIncluded,
|
||||
}
|
||||
|
||||
const showBreakfastStep = Boolean(
|
||||
breakfastPackages?.length && !breakfastIncluded
|
||||
)
|
||||
|
||||
return (
|
||||
<EnterDetailsProvider
|
||||
bedTypes={roomAvailability.bedTypes}
|
||||
booking={booking}
|
||||
breakfastPackages={breakfastPackages}
|
||||
showBreakfastStep={showBreakfastStep}
|
||||
packages={packages}
|
||||
roomRate={{
|
||||
memberRate: roomAvailability.memberRate,
|
||||
@@ -231,13 +236,13 @@ export default async function StepPage({
|
||||
</SectionAccordion>
|
||||
) : null}
|
||||
|
||||
{breakfastPackages?.length ? (
|
||||
{showBreakfastStep ? (
|
||||
<SectionAccordion
|
||||
header={intl.formatMessage({ id: "Food options" })}
|
||||
label={intl.formatMessage({ id: "Select breakfast options" })}
|
||||
step={StepEnum.breakfast}
|
||||
>
|
||||
<Breakfast packages={breakfastPackages} />
|
||||
<Breakfast packages={breakfastPackages!} />
|
||||
</SectionAccordion>
|
||||
) : null}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user