Skip to content

Commit

Permalink
feat: implement reset filter button
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
stdavis committed Jun 17, 2022
1 parent 4ae9737 commit e52b0c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Filter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ function reducer(draft, action) {

break;

case 'reset':
return initialState;

default:
throw new Error(`Unhandled action type: ${action.type}`);
}
Expand Down Expand Up @@ -208,7 +211,11 @@ export default function Filter({ mapView }) {
<CardHeader className="d-flex justify-content-between align-items-center">
Filter
<div className="d-flex align-items-center">
<Button className="reset-button text-decoration-none" color="link" onClick={() => {}}>
<Button
className="reset-button text-decoration-none"
color="link"
onClick={() => dispatch({ type: 'reset' })}
>
<small>reset</small>
</Button>
<Button close onClick={toggle} />
Expand Down

0 comments on commit e52b0c3

Please sign in to comment.