Merged in feat/SW-1495-hide-alerts-on-hotel-pages (pull request #1268)

feat(SW-1495): removed alerts on hotel pages when displayInBookingFlow is true

* feat(SW-1495): removed alerts on hotel pages when displayInBookingFlow is true


Approved-by: Fredrik Thorsson
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-02-10 07:40:38 +00:00
parent ce445e3f0b
commit 413c197ca0
2 changed files with 11 additions and 8 deletions

View File

@@ -169,14 +169,16 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
</div> </div>
{specialAlerts.length ? ( {specialAlerts.length ? (
<div className={styles.alertsContainer}> <div className={styles.alertsContainer}>
{specialAlerts.map((alert) => ( {specialAlerts
<Alert .filter((alert) => !alert.displayInBookingFlow)
key={alert.id} .map((alert) => (
type={alert.type} <Alert
heading={alert.heading} key={alert.id}
text={alert.text} type={alert.type}
/> heading={alert.heading}
))} text={alert.text}
/>
))}
</div> </div>
) : null} ) : null}
</div> </div>

View File

@@ -32,6 +32,7 @@ export const specialAlertsSchema = z
id: `alert-${alert.type}-${idx}`, id: `alert-${alert.type}-${idx}`,
text: alert.description || null, text: alert.description || null,
type: AlertTypeEnum.Info, type: AlertTypeEnum.Info,
displayInBookingFlow: alert.displayInBookingFlow,
})) }))
}) })
.default([]) .default([])