Add headers to InputAddress list (#2345)
This commit is contained in:
parent
06c0371fea
commit
b34982fda5
@ -10,6 +10,9 @@ import Dropdown from '../Dropdown';
|
||||
|
||||
export default function createHeader (option: KeyringSectionOption): React.ReactNode {
|
||||
return (
|
||||
<Dropdown.Header content={option.name} />
|
||||
<Dropdown.Header
|
||||
key={option.key || option.name}
|
||||
content={option.name}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ class InputAddress extends React.PureComponent<Props, State> {
|
||||
|
||||
return !optionsAll
|
||||
? []
|
||||
: optionsAll[type].filter(({ value }): boolean => !!value && (!filter || filter.includes(value)));
|
||||
: optionsAll[type].filter(({ value }): boolean => !filter || (!!value && filter.includes(value)));
|
||||
}
|
||||
|
||||
private onChange = (address: string): void => {
|
||||
@ -250,17 +250,13 @@ class InputAddress extends React.PureComponent<Props, State> {
|
||||
const query = _query.trim();
|
||||
const queryLower = query.toLowerCase();
|
||||
const matches = filteredOptions.filter((item): boolean =>
|
||||
item.value !== null && (
|
||||
!!item.value && (
|
||||
(item.name.toLowerCase && item.name.toLowerCase().includes(queryLower)) ||
|
||||
item.value.toLowerCase().includes(queryLower)
|
||||
)
|
||||
);
|
||||
|
||||
const valueMatches = matches.filter((item): boolean =>
|
||||
item.value !== null
|
||||
);
|
||||
|
||||
if (isInput && valueMatches.length === 0) {
|
||||
if (isInput && matches.length === 0) {
|
||||
const accountId = transformToAccountId(query);
|
||||
|
||||
if (accountId) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user