Merged in feat/SW-629-empty-state-hotel-page (pull request #901)

feat(SW-629): Added no availabilty if no hotels are listed

Approved-by: Niclas Edenvin
This commit is contained in:
Pontus Dreij
2024-11-15 07:19:16 +00:00
10 changed files with 72 additions and 25 deletions

View File

@@ -71,19 +71,17 @@ export default function HotelCardListing({
return (
<section className={styles.hotelCards}>
{hotels?.length ? (
hotels.map((hotel) => (
<HotelCard
key={hotel.hotelData.operaId}
hotel={hotel}
type={type}
state={hotel.hotelData.name === activeCard ? "active" : "default"}
onHotelCardHover={onHotelCardHover}
/>
))
) : (
<Title>No hotels found</Title>
)}
{hotels?.length
? hotels.map((hotel) => (
<HotelCard
key={hotel.hotelData.operaId}
hotel={hotel}
type={type}
state={hotel.hotelData.name === activeCard ? "active" : "default"}
onHotelCardHover={onHotelCardHover}
/>
))
: null}
</section>
)
}

View File

@@ -53,6 +53,10 @@ export default function HotelFilter({ filters }: HotelFiltersProps) {
return () => subscription.unsubscribe()
}, [handleSubmit, watch, submitFilter])
if (!filters.facilityFilters.length && !filters.surroundingsFilters.length) {
return null
}
return (
<aside className={styles.container}>
<FormProvider {...methods}>