Skip to content

Commit

Permalink
fix: Search bar initial value on Pools/Validators page (#2032)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankli-dev authored Apr 3, 2024
1 parent bf16d80 commit c4749c6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/library/List/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import { SearchInputWrapper } from '.';
import type { SearchInputProps } from './types';

export const SearchInput = ({
value,
handleChange,
placeholder,
}: SearchInputProps) => (
<SearchInputWrapper>
<input
type="text"
value={value}
className="search"
placeholder={placeholder}
onChange={(e: FormEvent<HTMLInputElement>) => handleChange(e)}
Expand Down
1 change: 1 addition & 0 deletions src/library/List/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface PaginationProps {
}

export interface SearchInputProps {
value: string;
handleChange: (e: FormEvent<HTMLInputElement>) => void;
placeholder: string;
}
Expand Down
1 change: 1 addition & 0 deletions src/library/PoolList/Default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export const PoolList = ({
<List $flexBasisLarge={allowMoreCols ? '33.33%' : '50%'}>
{allowSearch && poolsDefault.length > 0 && (
<SearchInput
value={searchTerm ?? ''}
handleChange={handleSearchChange}
placeholder={t('search')}
/>
Expand Down
1 change: 1 addition & 0 deletions src/library/ValidatorList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ export const ValidatorListInner = ({
<List $flexBasisLarge={allowMoreCols ? '33.33%' : '50%'}>
{allowSearch && (
<SearchInput
value={searchTerm ?? ''}
handleChange={handleSearchChange}
placeholder={t('searchAddress')}
/>
Expand Down

0 comments on commit c4749c6

Please sign in to comment.