diff --git a/components/Filter/index.tsx b/components/Filter/index.tsx index a720b0c..14a0119 100644 --- a/components/Filter/index.tsx +++ b/components/Filter/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import StatusDropdown from '@/components/StatusDropdown'; import TechnologyDropdown from '@/components/TechnologyDropdown'; import { FilterHeadingUnused } from '@/styles/texts'; diff --git a/components/FilterBar/index.tsx b/components/FilterBar/index.tsx index e04b1cb..5650398 100644 --- a/components/FilterBar/index.tsx +++ b/components/FilterBar/index.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; import Filter from '@/components/Filter'; import { FilterChangeHandlers, Filters, FilterType } from '@/types/schema'; import { FilterContainerStyles } from './styles'; diff --git a/components/MapViewScreen/index.tsx b/components/MapViewScreen/index.tsx index 122bbee..3a26d0d 100644 --- a/components/MapViewScreen/index.tsx +++ b/components/MapViewScreen/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { useMap } from '@vis.gl/react-google-maps'; import { LocationIcon, @@ -101,7 +101,14 @@ export default function MapViewScreen({ if (filteredProjectsFromDropdowns.length > 0) { projectsToSearch = filteredProjectsFromDropdowns; - } else { + } else if ( + Object.values(selectedFilters).every(filter => + Array.isArray(filter) + ? filter.length === 0 + : filter.min === 0 && filter.max === 0, + ) + ) { + // Only fallback to all projects if no filters are applied projectsToSearch = projects; } diff --git a/components/StatusDropdown/index.tsx b/components/StatusDropdown/index.tsx index 0c3d1d4..2ea232c 100644 --- a/components/StatusDropdown/index.tsx +++ b/components/StatusDropdown/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; //REMOVE import { FilterType } from '@/types/schema'; import { ExitIcon } from '../../assets/Dropdown-Icons/icons'; import COLORS from '../../styles/colors'; diff --git a/components/TechnologyDropdown/index.tsx b/components/TechnologyDropdown/index.tsx index 8bdf2a4..b49c48c 100644 --- a/components/TechnologyDropdown/index.tsx +++ b/components/TechnologyDropdown/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { ApplyFiltersText, FilterCategoryLabel,