code100x / job-board

100xdevs job board - temp domain attached ( will update soon )
https://job.vineet.tech
313 stars 448 forks source link

🚀 Feature: Conditionally render Clear Filters button based on filter selection #488

Closed Ahmadmidlaj closed 3 weeks ago

Ahmadmidlaj commented 3 weeks ago

🔖 Feature description

Add conditional rendering for the Clear Filters button in the JobFilters component. The button should only appear when at least one filter is selected, improving the user interface and reducing clutter.

🎤 Why is this feature needed ?

Currently, the Clear Filters button is always visible, even when no filters are selected. This can lead to a cluttered interface and potential user confusion. By only showing the button when filters are active, we can improve the user experience by:

  1. Reducing visual noise when no filters are applied
  2. Providing a clear indication that filters are in use
  3. Offering an easy way to reset filters only when necessary

This change will make the job search interface cleaner and more intuitive for users.

✌️ How do you aim to achieve this?

  1. Create a new custom hook called useFilterCheck to determine if any filters are selected
  2. Update the JobFilters component to use this new hook
  3. Modify the rendering of the Clear Filters button to be conditional based on the hook's output

The implementation will involve:

🔄️ Additional Information

An alternative approach could be to disable the Clear Filters button when no filters are selected, rather than hiding it completely. However, hiding the button when it's not needed provides a cleaner interface and is more aligned with modern UI practices.

👀 Have you spent some time to check if this feature request has been raised before?

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!