fix: util function names for filter
This commit is contained in:
parent
66093a8f9c
commit
5fb05ad24d
|
@ -63,14 +63,14 @@ type ManagementTableProps = {
|
|||
tab: string
|
||||
}
|
||||
|
||||
const testValidatorStatus = (validatorStatus: string, tabStatus: string) => {
|
||||
const isValidStatus = (validatorStatus: string, tabStatus: string) => {
|
||||
if (validatorStatus === tabStatus || tabStatus === VALIDATOR_TABS[VALIDATOR_TABS.length - 1]) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const testNumberAndAddress = (
|
||||
const isValidNumberOrAddress = (
|
||||
validatorNumber: number,
|
||||
validatorAddress: string,
|
||||
searchValue: string,
|
||||
|
@ -86,8 +86,8 @@ const ManagementTable = ({ tab }: ManagementTableProps) => {
|
|||
|
||||
const filteredValidators = useMemo(() => {
|
||||
return validators
|
||||
.filter(validator => testValidatorStatus(validator.status, tab))
|
||||
.filter(validator => testNumberAndAddress(validator.number, validator.address, searchValue))
|
||||
.filter(validator => isValidStatus(validator.status, tab))
|
||||
.filter(validator => isValidNumberOrAddress(validator.number, validator.address, searchValue))
|
||||
}, [tab, searchValue])
|
||||
|
||||
const changeSearchValue = (value: string) => {
|
||||
|
|
Loading…
Reference in New Issue