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>
{specialAlerts.length ? (
<div className={styles.alertsContainer}>
{specialAlerts.map((alert) => (
<Alert
key={alert.id}
type={alert.type}
heading={alert.heading}
text={alert.text}
/>
))}
{specialAlerts
.filter((alert) => !alert.displayInBookingFlow)
.map((alert) => (
<Alert
key={alert.id}
type={alert.type}
heading={alert.heading}
text={alert.text}
/>
))}
</div>
) : null}
</div>

View File

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