From b76097fb3b49f06ed82f84bd05bca196e8e71f1c Mon Sep 17 00:00:00 2001 From: Pratik Gupta <36588068+CyberSpyderX@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:35:47 -0400 Subject: [PATCH] Added Clear filters option + UI fixes (#471) (#474) --- src/layouts/job-filters.tsx | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/layouts/job-filters.tsx b/src/layouts/job-filters.tsx index 7470def3..1e5ae10c 100644 --- a/src/layouts/job-filters.tsx +++ b/src/layouts/job-filters.tsx @@ -21,7 +21,6 @@ import { FormLabel, FormMessage, } from '../components/ui/form'; -import { Separator } from '../components/ui/separator'; import { ScrollArea } from '@/components/ui/scroll-area'; import { cn } from '@/lib/utils'; import useSetQueryParams from '@/hooks/useSetQueryParams'; @@ -55,6 +54,16 @@ const JobFilters = ({ searchParams }: { searchParams: JobQuerySchemaType }) => { return cities; } + function clearFilters() { + form.reset({ + page: DEFAULT_PAGE, + workmode: [], + EmpType: [], + salaryrange: [], + city: [], + }); + } + useEffect(() => { fetchCityFilters(); }, []); @@ -71,13 +80,18 @@ const JobFilters = ({ searchParams }: { searchParams: JobQuerySchemaType }) => { 'rounded-lg bg-background min-w-[290px] p-6 h-fit top-20' )} > -