feat: add change handler for search
This commit is contained in:
parent
17b2c34845
commit
7b50860749
|
@ -3,24 +3,20 @@ import { SearchIcon } from '@status-im/icons'
|
|||
|
||||
type InputSearchProps = {
|
||||
value: string
|
||||
setValue: (value: string) => void
|
||||
changeSearchValue: (value: string) => void
|
||||
}
|
||||
const InputSearch = ({ value, setValue }: InputSearchProps) => {
|
||||
|
||||
const InputSearch = ({ value, changeSearchValue }: InputSearchProps) => {
|
||||
return (
|
||||
<>
|
||||
<Input
|
||||
placeholder="Search Validators"
|
||||
value={value}
|
||||
onChangeText={setValue}
|
||||
icon={<SearchIcon size={20} />}
|
||||
onClear={() => setValue('')}
|
||||
size={40}
|
||||
// button={{
|
||||
// label: 'Confirm',
|
||||
// onPress: () => alert('Confirmed!'),
|
||||
// }}
|
||||
/>
|
||||
</>
|
||||
<Input
|
||||
placeholder="Search Validators"
|
||||
value={value}
|
||||
onChangeText={changeSearchValue}
|
||||
icon={<SearchIcon size={20} />}
|
||||
onClear={() => changeSearchValue('')}
|
||||
size={40}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default InputSearch
|
||||
|
|
|
@ -47,10 +47,13 @@ const ValidatorsList = () => {
|
|||
dispatch(setCountOfValidators(filteredCount))
|
||||
}, [searchValue, validators])
|
||||
|
||||
const changeSearchValue = (value: string) => {
|
||||
setSearchValue(value)
|
||||
}
|
||||
|
||||
return (
|
||||
<YStack>
|
||||
<InputSearch value={searchValue} setValue={setSearchValue} />
|
||||
<InputSearch value={searchValue} changeSearchValue={changeSearchValue} />
|
||||
<YStack space={'$1'} mt={'16px'}>
|
||||
{filteredValidators.map(validator => (
|
||||
<ValidatorListItem {...validator} />
|
||||
|
|
Loading…
Reference in New Issue