diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_city_page/[uid]/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_city_page/[uid]/page.tsx index 60398aebe..179ad13e9 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_city_page/[uid]/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_city_page/[uid]/page.tsx @@ -10,16 +10,13 @@ import type { PageArgs } from "@/types/params" export { generateMetadata } from "@/utils/metadata/generateMetadata" export default async function DestinationCityPagePage( - props: PageArgs + props: PageArgs ) { const searchParams = await props.searchParams return (
}> - +
) diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_country_page/[uid]/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_country_page/[uid]/page.tsx index 534c37e9b..c611404b6 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_country_page/[uid]/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/(contentTypes)/destination_country_page/[uid]/page.tsx @@ -5,20 +5,16 @@ import DestinationCountryPageSkeleton from "@/components/ContentType/Destination import styles from "./page.module.css" -import type { PageArgs } from "@/types/params" - export { generateMetadata } from "@/utils/metadata/generateMetadata" -export default async function DestinationCountryPagePage( - props: PageArgs -) { - const searchParams = await props.searchParams +export default async function DestinationCountryPagePage() { + // props: PageArgs<{}, { view?: "map"; }> + // const searchParams = await props.searchParams return (
}> diff --git a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/HotelList/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/HotelList/index.tsx index c6679877a..3271536ec 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/HotelList/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/HotelList/index.tsx @@ -44,16 +44,24 @@ export default function HotelList() { return } - function handleBoundsChanged() { - debouncedUpdateVisibleHotels() - } - - coreLib.event.addListener(map, "bounds_changed", handleBoundsChanged) + coreLib.event.addListener( + map, + "bounds_changed", + debouncedUpdateVisibleHotels + ) return () => { coreLib.event.clearListeners(map, "bounds_changed") } }, [map, coreLib, debouncedUpdateVisibleHotels]) + useEffect(() => { + if (!map) { + return + } + + setVisibleHotels(getVisibleHotels(activeHotels, map)) + }, [map, activeHotels]) + if (isLoading) { return } diff --git a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/index.tsx index 3469ae644..7efddd9a0 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/CityMap/index.tsx @@ -29,11 +29,11 @@ export default function CityMap({ defaultLocation, }: CityMapProps) { const intl = useIntl() - const { activeHotels, allFilters, activeFilters } = useDestinationDataStore( + const { activeHotels, allFilters, filterFromUrl } = useDestinationDataStore( (state) => ({ activeHotels: state.activeHotels, allFilters: state.allFilters, - activeFilters: state.activeFilters, + filterFromUrl: state.filterFromUrl, }) ) @@ -47,7 +47,7 @@ export default function CityMap({ >

- {getHeadingText(intl, city.name, allFilters, activeFilters[0])} + {getHeadingText(intl, city.name, allFilters, filterFromUrl)}

diff --git a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx index 2bebf8e5d..c0ea35bcc 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCityPage/index.tsx @@ -28,7 +28,6 @@ import DestinationPageSidePeek from "../Sidepeek" import StaticMap from "../StaticMap" import TopImages from "../TopImages" import DestinationTracking from "../Tracking" -import { getHeadingText } from "../utils" import CityMap from "./CityMap" import DestinationCityPageSkeleton from "./DestinationCityPageSkeleton" @@ -36,12 +35,10 @@ import styles from "./destinationCityPage.module.css" interface DestinationCityPageProps { isMapView: boolean - filterFromUrl?: string } export default async function DestinationCityPage({ isMapView, - filterFromUrl, }: DestinationCityPageProps) { const intl = await getIntl() const lang = await getLang() @@ -94,7 +91,6 @@ export default async function DestinationCityPage({ @@ -120,16 +116,7 @@ export default async function DestinationCityPage({ {blocks && }