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:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user