From 7b50860749814b23848f0106a5d09abf0fe140de Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Thu, 19 Oct 2023 09:37:51 +0300 Subject: [PATCH] feat: add change handler for search --- .../ValidatorsTabs/SearchInput.tsx | 28 ++++++++----------- .../ValidatorsTabs/ValidatorsList.tsx | 5 +++- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.tsx b/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.tsx index d99a29c9..6386d8aa 100644 --- a/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.tsx +++ b/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.tsx @@ -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 ( - <> - } - onClear={() => setValue('')} - size={40} - // button={{ - // label: 'Confirm', - // onPress: () => alert('Confirmed!'), - // }} - /> - + } + onClear={() => changeSearchValue('')} + size={40} + /> ) } + export default InputSearch diff --git a/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx b/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx index 297f7216..d47e527a 100644 --- a/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx +++ b/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx @@ -47,10 +47,13 @@ const ValidatorsList = () => { dispatch(setCountOfValidators(filteredCount)) }, [searchValue, validators]) + const changeSearchValue = (value: string) => { + setSearchValue(value) + } return ( - + {filteredValidators.map(validator => (