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