From ff9c4a03ae8d6f3aaa72060b7aa8099a211944b9 Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Thu, 19 Oct 2023 11:09:01 +0300 Subject: [PATCH] fix: change search state and component names --- .../ValidatorsTabs/SearchInput.stories.tsx | 25 ------------------- .../SearchValidatorsInput.stories.tsx | 25 +++++++++++++++++++ ...rchInput.tsx => SearchValidatorsInput.tsx} | 8 +++--- .../ValidatorsTabs/ValidatorsList.tsx | 4 +-- 4 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 src/components/General/RightSideBar/ValidatorsTabs/SearchInput.stories.tsx create mode 100644 src/components/General/RightSideBar/ValidatorsTabs/SearchValidatorsInput.stories.tsx rename src/components/General/RightSideBar/ValidatorsTabs/{SearchInput.tsx => SearchValidatorsInput.tsx} (68%) diff --git a/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.stories.tsx b/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.stories.tsx deleted file mode 100644 index ef25a026..00000000 --- a/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.stories.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { useState } from 'react' -import type { Meta, StoryObj } from '@storybook/react' -import SearchInput from './SearchInput' - -const meta = { - title: 'General/SearchInput', - component: SearchInput, - parameters: { - layout: 'centered', - }, - tags: ['autodocs'], -} satisfies Meta - -export default meta -type Story = StoryObj - -export const Default: Story = (args: { value: string }) => { - const [searchValue, setSearchValue] = useState(args.value) - - return -} - -Default.args = { - value: '', -} diff --git a/src/components/General/RightSideBar/ValidatorsTabs/SearchValidatorsInput.stories.tsx b/src/components/General/RightSideBar/ValidatorsTabs/SearchValidatorsInput.stories.tsx new file mode 100644 index 00000000..454a1884 --- /dev/null +++ b/src/components/General/RightSideBar/ValidatorsTabs/SearchValidatorsInput.stories.tsx @@ -0,0 +1,25 @@ +import { useState } from 'react' +import type { Meta, StoryObj } from '@storybook/react' +import SearchValidatorsInput from './SearchValidatorsInput' + +const meta = { + title: 'General/SearchValidatorsInput', + component: SearchValidatorsInput, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], +} satisfies Meta + +export default meta +type Story = StoryObj + +export const Default: Story = (args: { searchValue: string }) => { + const [searchValue, setSearchValue] = useState(args.searchValue) + + return +} + +Default.args = { + searchValue: '', +} diff --git a/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.tsx b/src/components/General/RightSideBar/ValidatorsTabs/SearchValidatorsInput.tsx similarity index 68% rename from src/components/General/RightSideBar/ValidatorsTabs/SearchInput.tsx rename to src/components/General/RightSideBar/ValidatorsTabs/SearchValidatorsInput.tsx index 6386d8aa..00510a29 100644 --- a/src/components/General/RightSideBar/ValidatorsTabs/SearchInput.tsx +++ b/src/components/General/RightSideBar/ValidatorsTabs/SearchValidatorsInput.tsx @@ -2,15 +2,15 @@ import { Input } from '@status-im/components' import { SearchIcon } from '@status-im/icons' type InputSearchProps = { - value: string + searchValue: string changeSearchValue: (value: string) => void } -const InputSearch = ({ value, changeSearchValue }: InputSearchProps) => { +const SearchValidatorsInput = ({ searchValue, changeSearchValue }: InputSearchProps) => { return ( } onClear={() => changeSearchValue('')} @@ -19,4 +19,4 @@ const InputSearch = ({ value, changeSearchValue }: InputSearchProps) => { ) } -export default InputSearch +export default SearchValidatorsInput diff --git a/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx b/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx index a73a9123..dfe0828f 100644 --- a/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx +++ b/src/components/General/RightSideBar/ValidatorsTabs/ValidatorsList.tsx @@ -5,7 +5,7 @@ import { Text } from '@status-im/components' import { setCountOfValidators } from '../../../../redux/RightSidebar/slice' import ValidatorListItem from './ValidatorListItem' -import InputSearch from './SearchInput' +import SearchValidatorsInput from './SearchValidatorsInput' type Validator = { name: string @@ -48,7 +48,7 @@ const ValidatorsList = () => { return ( - + {filteredValidators.map(validator => (