Merged in fix/SW-1491-SW-1500-link-in-hotel-card-to-map (pull request #1707)

fix(SW-1491-SW-1500): address on hotel card should go to map, remove link on maplisting view

* fix(SW-1491-SW-1500): address on hotel card should go to map, remove link on maplisting view

* fix(SW-1491-SW-1500): fix comment

* fix(SW-1491-SW-1500): add underscore


Approved-by: Niclas Edenvin
This commit is contained in:
Bianca Widstam
2025-04-03 06:56:23 +00:00
parent 0215c8428f
commit 83aedd7dbb
6 changed files with 93 additions and 75 deletions
@@ -1,7 +1,3 @@
.hotelListing {
display: none;
}
.hotelListingMobile {
display: none;
overflow-x: auto;
@@ -16,16 +12,9 @@
display: flex;
}
@media (min-width: 768px) {
.hotelListing {
display: block;
width: 100%;
overflow-y: auto;
padding-top: var(--Spacing-x2);
}
.hotelListingMobile,
.hotelListingMobile[data-open="true"] {
display: none;
}
.hotelListing {
display: block;
width: 100%;
overflow-y: auto;
padding-top: var(--Spacing-x2);
}
@@ -1,5 +1,7 @@
"use client"
import { useMediaQuery } from "usehooks-ts"
import { useHotelsMapStore } from "@/stores/hotels-map"
import HotelCardDialogListing from "@/components/HotelReservation/HotelCardDialogListing"
@@ -12,17 +14,21 @@ import type { HotelListingProps } from "@/types/components/hotelReservation/sele
export default function HotelListing({ hotels }: HotelListingProps) {
const { activeHotelPin } = useHotelsMapStore()
const isMobile = useMediaQuery("(max-width: 767px)")
return (
<>
<div className={styles.hotelListing}>
<HotelCardListing
hotelData={hotels}
type={HotelCardListingTypeEnum.MapListing}
/>
</div>
<div className={styles.hotelListingMobile} data-open={!!activeHotelPin}>
<HotelCardDialogListing hotels={hotels} />
</div>
{isMobile ? (
<div className={styles.hotelListingMobile} data-open={!!activeHotelPin}>
<HotelCardDialogListing hotels={hotels} />
</div>
) : (
<div className={styles.hotelListing}>
<HotelCardListing
hotelData={hotels}
type={HotelCardListingTypeEnum.MapListing}
/>
</div>
)}
</>
)
}