Skip to content

Commit

Permalink
fix: reset filter and date range filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bubblegan committed Nov 26, 2024
1 parent b0f0543 commit b6d8d00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/web/components/date-range-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const DateRangePicker = () => {
});
setStartDateInput(startDateParsed.format("DD MMM, YYYY"));
setEndDateInput(endDateParsed.format("DD MMM, YYYY"));
} else {
setDateRange(undefined);
setStartDateInput("");
setEndDateInput("");
}
}, [searchParams]);

Expand Down
10 changes: 10 additions & 0 deletions apps/web/pages/expenses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ export default function Expenses() {
<span>Count: {totalCount}</span>
</div>
<ExpenseFilterPills />
{searchParams.size > 0 && (
<Button
onClick={() => {
router.push(`/expenses`, undefined, {
shallow: true,
});
}}>
Reset Filter
</Button>
)}
</div>
{view === "aggregate" ? <ExpenseSummarySection /> : <ExpenseTable />}
</div>
Expand Down

0 comments on commit b6d8d00

Please sign in to comment.