Merged in fix/book-674-select-hotel-infinite-loop (pull request #3351)

fix(BOOK-674): Refactor how we handle hotel filters

* Refactor hotel filters store to URL state

* Rename hotel filter store


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-12-15 13:58:00 +00:00
parent 494bf2ba78
commit 713ca6562e
10 changed files with 120 additions and 139 deletions

View File

@@ -27,12 +27,13 @@ import {
BookingCodeFilterEnum,
useBookingCodeFilterStore,
} from "../../../../stores/bookingCode-filter"
import { useHotelFilterStore } from "../../../../stores/hotel-filters"
import { useHotelResultCountStore } from "../../../../stores/hotel-result-count"
import { useHotelsMapStore } from "../../../../stores/hotels-map"
import BookingCodeFilter from "../../../BookingCodeFilter"
import { getHotelPins } from "../../../HotelCardDialogListing/utils"
import { RoomCardSkeleton } from "../../../RoomCardSkeleton/RoomCardSkeleton"
import FilterAndSortModal from "../../Filters/FilterAndSortModal"
import { useHotelFilters } from "../../Filters/useHotelFilters"
import { type HotelResponse } from "../../helpers"
import HotelListing from "../HotelListing"
import { getVisibleHotels } from "./utils"
@@ -75,8 +76,10 @@ export function SelectHotelMapContent({
const [showSkeleton, setShowSkeleton] = useState<boolean>(true)
const listingContainerRef = useRef<HTMLDivElement | null>(null)
const activeFilters = useHotelFilterStore((state) => state.activeFilters)
const setResultCount = useHotelFilterStore((state) => state.setResultCount)
const [activeFilters] = useHotelFilters(null)
const setResultCount = useHotelResultCountStore(
(state) => state.setResultCount
)
const pointsCurrency = useGetPointsCurrency()
const hotelMapStore = useHotelsMapStore()