Merged in fix/SW-2808-remove-filter-no-availability-messge (pull request #2447)
fix(SW-2808): remove no hotels match your filter as it will never appear due to changed logic * fix(SW-2808): remove no hotels match your filter as it will never appear due to changed logic Approved-by: Tobias Johansson
This commit is contained in:
@@ -2,15 +2,11 @@
|
|||||||
import { useSearchParams } from "next/navigation"
|
import { useSearchParams } from "next/navigation"
|
||||||
import { useSession } from "next-auth/react"
|
import { useSession } from "next-auth/react"
|
||||||
import { useEffect, useMemo, useRef } from "react"
|
import { useEffect, useMemo, useRef } from "react"
|
||||||
import { useIntl } from "react-intl"
|
|
||||||
|
|
||||||
import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType"
|
|
||||||
|
|
||||||
import { useBookingCodeFilterStore } from "@/stores/bookingCode-filter"
|
import { useBookingCodeFilterStore } from "@/stores/bookingCode-filter"
|
||||||
import { useHotelFilterStore } from "@/stores/hotel-filters"
|
import { useHotelFilterStore } from "@/stores/hotel-filters"
|
||||||
import { useHotelsMapStore } from "@/stores/hotels-map"
|
import { useHotelsMapStore } from "@/stores/hotels-map"
|
||||||
|
|
||||||
import Alert from "@/components/TempDesignSystem/Alert"
|
|
||||||
import { BackToTopButton } from "@/components/TempDesignSystem/BackToTopButton"
|
import { BackToTopButton } from "@/components/TempDesignSystem/BackToTopButton"
|
||||||
import { useScrollToTop } from "@/hooks/useScrollToTop"
|
import { useScrollToTop } from "@/hooks/useScrollToTop"
|
||||||
import { isValidClientSession } from "@/utils/clientSession"
|
import { isValidClientSession } from "@/utils/clientSession"
|
||||||
@@ -37,7 +33,6 @@ export default function HotelCardListing({
|
|||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
const activeFilters = useHotelFilterStore((state) => state.activeFilters)
|
const activeFilters = useHotelFilterStore((state) => state.activeFilters)
|
||||||
const setResultCount = useHotelFilterStore((state) => state.setResultCount)
|
const setResultCount = useHotelFilterStore((state) => state.setResultCount)
|
||||||
const intl = useIntl()
|
|
||||||
const { activeHotel } = useHotelsMapStore()
|
const { activeHotel } = useHotelsMapStore()
|
||||||
const { showBackToTop, scrollToTop } = useScrollToTop({ threshold: 490 })
|
const { showBackToTop, scrollToTop } = useScrollToTop({ threshold: 490 })
|
||||||
const activeCardRef = useRef<HTMLDivElement | null>(null)
|
const activeCardRef = useRef<HTMLDivElement | null>(null)
|
||||||
@@ -142,18 +137,6 @@ export default function HotelCardListing({
|
|||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
: null}
|
: null}
|
||||||
{!hotels?.length && activeFilters ? (
|
|
||||||
<Alert
|
|
||||||
type={AlertTypeEnum.Info}
|
|
||||||
heading={intl.formatMessage({
|
|
||||||
defaultMessage: "No hotels match your filters",
|
|
||||||
})}
|
|
||||||
text={intl.formatMessage({
|
|
||||||
defaultMessage:
|
|
||||||
"It looks like no hotels match your filters. Try adjusting your search to find the perfect stay.",
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{showBackToTop && (
|
{showBackToTop && (
|
||||||
<BackToTopButton position="right" onClick={scrollToTop} />
|
<BackToTopButton position="right" onClick={scrollToTop} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user