From 4ab586660ab7fdb3499d68a5b2a760f4ba7edd36 Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Wed, 5 Mar 2025 12:32:53 +0000 Subject: [PATCH] Merged in feat/SW-1738-mobile-tablet-design-filtering (pull request #1472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat/SW-1738 mobile tablet design filtering * feat(SW-1738): add top bar * feat(SW-1738): set list type * feat(SW-1738): mobile design for filter modal * feat(SW-1738): change button component * feat(SW-1738): hide divider * feat(SW-1738): set list type * feat(SW-1738): remove background color from checkbox wrapper in mobile * feat(SW-1738): remove props from filter and sort component Approved-by: Erik Tiekstra Approved-by: Matilda Landström --- .../DestinationPage/CityListing/index.tsx | 17 ++----- .../CityMap/HotelList/hotelList.module.css | 5 +- .../CityMap/HotelList/index.tsx | 17 ++----- .../HotelListItem/hotelListItem.module.css | 7 ++- .../CountryMap/CityList/cityList.module.css | 5 +- .../CountryMap/CityList/index.tsx | 17 ++----- .../DestinationPage/HotelListing/index.tsx | 17 ++----- .../Map/DynamicMap/dynamicMap.module.css | 11 ++-- .../ContentType/DestinationPage/Map/index.tsx | 20 ++++++++ .../DestinationPage/Map/map.module.css | 15 ++++++ .../Filter/Checkbox/checkbox.module.css | 10 ++++ .../Filter/filter.module.css | 10 ++++ .../DestinationFilterAndSort/Filter/index.tsx | 4 +- .../destinationFilterAndSort.module.css | 51 +++++++++++++++++++ .../DestinationFilterAndSort/index.tsx | 28 +++++----- 15 files changed, 157 insertions(+), 77 deletions(-) diff --git a/apps/scandic-web/components/ContentType/DestinationPage/CityListing/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/CityListing/index.tsx index 641745d77..88a038ab8 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/CityListing/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/CityListing/index.tsx @@ -26,13 +26,10 @@ export default function CityListing() { threshold: 300, elementRef: scrollRef, }) - const { activeCities, filters, sortItems, isLoading } = - useDestinationDataStore((state) => ({ - activeCities: state.activeCities, - filters: state.allFilters, - sortItems: state.sortItems, - isLoading: state.isLoading, - })) + const { activeCities, isLoading } = useDestinationDataStore((state) => ({ + activeCities: state.activeCities, + isLoading: state.isLoading, + })) const [allCitiesVisible, setAllCitiesVisible] = useState( activeCities.length <= 5 ) @@ -57,11 +54,7 @@ export default function CityListing() { { count: activeCities.length } )} - + {activeCities.length === 0 ? ( ([]) - const { filters, sortItems, activeHotels, isLoading } = - useDestinationDataStore((state) => ({ - filters: state.allFilters, - sortItems: state.sortItems, - activeHotels: state.activeHotels, - isLoading: state.isLoading, - })) + const { activeHotels, isLoading } = useDestinationDataStore((state) => ({ + activeHotels: state.activeHotels, + isLoading: state.isLoading, + })) const debouncedUpdateVisibleHotels = useMemo( () => @@ -67,11 +64,7 @@ export default function HotelList() { { count: visibleHotels.length } )} - + {activeHotels.length === 0 ? ( ({ - filters: state.allFilters, - sortItems: state.sortItems, - activeCities: state.activeCities, - isLoading: state.isLoading, - })) + const { activeCities, isLoading } = useDestinationDataStore((state) => ({ + activeCities: state.activeCities, + isLoading: state.isLoading, + })) return isLoading ? ( @@ -36,11 +33,7 @@ export default function CityList() { { count: activeCities.length } )} - + {activeCities.length === 0 ? ( ({ - activeHotels: state.activeHotels, - filters: state.allFilters, - sortItems: state.sortItems, - isLoading: state.isLoading, - })) + const { activeHotels, isLoading } = useDestinationDataStore((state) => ({ + activeHotels: state.activeHotels, + isLoading: state.isLoading, + })) const [allHotelsVisible, setAllHotelsVisible] = useState( activeHotels.length <= 5 ) @@ -57,11 +54,7 @@ export default function HotelListing() { { count: activeHotels.length } )} - + {activeHotels.length === 0 ? ( +
+ + +
    {facilityFilters.map((filter) => ( -
  • +
    • {surroundingsFilters.map((filter) => ( -
    • +
    • ({ + filters: state.allFilters, + sortItems: state.sortItems, pendingFilters: state.pendingFilters, pendingSort: state.pendingSort, basePath: state.basePathnameWithoutFilters, @@ -142,13 +138,17 @@ export default function DestinationFilterAndSort({ >

      {intl.formatMessage({ id: "Filter and sort" })}

      - +
      - +
      {pendingCount === 0 && ( @@ -171,7 +171,7 @@ export default function DestinationFilterAndSort({ {intl.formatMessage({ id: "Clear all filters" })}