diff --git a/frontend/src/components/FilterDropdown.js b/frontend/src/components/FilterDropdown.js index f1f97df..a7a35b3 100644 --- a/frontend/src/components/FilterDropdown.js +++ b/frontend/src/components/FilterDropdown.js @@ -4,6 +4,7 @@ import { Button, Menu, MenuButton, + MenuItem, MenuList, MenuItemOption, MenuOptionGroup, @@ -26,10 +27,30 @@ const FilterDropdown = ({ filter, setFilter }) => { > Filter Tickets - + + { + if ( + filter.length === + Object.keys(TICKET_TYPES).length + ) { + setFilter([]) + setSearchParams({ + tickettypes: '', + }) + } else { + setFilter(Object.keys(TICKET_TYPES)) + searchParams.delete('tickettypes') + setSearchParams(searchParams) + } + }} + > + {filter.length === Object.keys(TICKET_TYPES).length + ? 'Deselect All' + : 'Select All'} + { setFilter(value) @@ -47,16 +68,16 @@ const FilterDropdown = ({ filter, setFilter }) => { } }} > - + Sponsorship Funds - + Funding Items - + Personal Purchase Requests - + UW Finance Purchase Requests