Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Search bar initial value on Pools/Validators page #2032

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading