|
|
|
|
@ -68,17 +68,23 @@ export const useMatchFilters = ({ |
|
|
|
|
}: TUseMatchFilters) => { |
|
|
|
|
const [matchesList, setMatchesList] = useState<Array<Match>>([]) |
|
|
|
|
const [tournamentMatches, setTournamentMatches] = useState<Array<Match>>([]) |
|
|
|
|
const [isOpenList, setOpenList] = useState<string>('') |
|
|
|
|
const [filtersListName, setFiltersListName] = useState<string>('') |
|
|
|
|
const [activeFilters, setActiveFilters] = useState<TActiveFilters>(DEFAULT_FILTERS) |
|
|
|
|
const [inputValue, setInputValue] = useState<string>('') |
|
|
|
|
const [openPopup, setOpenPopup] = useState(false) |
|
|
|
|
|
|
|
|
|
const openDropdownList = (title: string) => () => { |
|
|
|
|
setOpenList(title === isOpenList ? '' : title) |
|
|
|
|
const toggleDropdownList = (title: string) => () => { |
|
|
|
|
if (title === filtersListName) { |
|
|
|
|
setFiltersListName('') |
|
|
|
|
setInputValue('') |
|
|
|
|
} else { |
|
|
|
|
setFiltersListName(title) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const closeDropdownList = () => { |
|
|
|
|
setOpenList('') |
|
|
|
|
setFiltersListName('') |
|
|
|
|
setInputValue('') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const clearAllFilters = () => { |
|
|
|
|
@ -266,17 +272,17 @@ export const useMatchFilters = ({ |
|
|
|
|
closeDropdownList, |
|
|
|
|
confirmClear, |
|
|
|
|
currentFilters, |
|
|
|
|
filtersListName, |
|
|
|
|
filtersSize, |
|
|
|
|
getDropdownList, |
|
|
|
|
handleSetFilters, |
|
|
|
|
inputValue, |
|
|
|
|
isEmptyFilters, |
|
|
|
|
isFiltersShown, |
|
|
|
|
isOpenList, |
|
|
|
|
matchesList, |
|
|
|
|
openDropdownList, |
|
|
|
|
openPopup, |
|
|
|
|
queryParams, |
|
|
|
|
setTournamentMatches, |
|
|
|
|
toggleDropdownList, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|