Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/find-properties/[[...opa_id]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ const MapPage = ({ params }: MapPageProps) => {
</div>
</div>
) : currentView === 'filter' ? (
<FilterView updateCurrentView={updateCurrentView} />
<FilterView />
) : (
<PropertyDetailSection
featuresInView={featuresInView}
Expand Down
24 changes: 14 additions & 10 deletions src/components/FilterView.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
'use client';

import { FC } from 'react';
import { PiX } from 'react-icons/pi';
import { ThemeButton } from './ThemeButton';
import { BarClickOptions } from '@/app/find-properties/[[...opa_id]]/page';

Check warning on line 5 in src/components/FilterView.tsx

View workflow job for this annotation

GitHub Actions / lint

'BarClickOptions' is defined but never used
import { rcos, neighborhoods, zoning } from './Filters/filterOptions';
import FilterDescription from './Filters/FilterDescription';
import ButtonGroup from './Filters/ButtonGroup';
import MultiSelect from './Filters/MultiSelect';
import Panels from './Filters/Panels';
import { useFilter } from '@/context/FilterContext';

interface FilterViewProps {
updateCurrentView: (view: BarClickOptions) => void;
}
const FilterView: FC = () => {
const { dispatch } = useFilter();

const onResetButtonPressed = () => {
dispatch({
type: 'CLEAR_DIMENSIONS',
property: 'reset',
dimensions: [],
});
};

const FilterView: FC<FilterViewProps> = ({ updateCurrentView }) => {
return (
<div className="relative p-6">
{/* Add ID to the close button */}
<ThemeButton
color="secondary"
className="right-4 lg:right-[24px] absolute top-8 min-w-[3rem]"
aria-label="Close filter panel"
startContent={<PiX />}
label={'Reset'}
aria-label="Reset filters"
id="close-filter-button" // Add an ID to this button
onPress={() => {
updateCurrentView('filter');
}}
onPress={onResetButtonPressed}
/>
<div className="pt-3 pb-6">
<FilterDescription
Expand Down
Loading