mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-13 20:08:56 +00:00
token already added message
This commit is contained in:
parent
a1bad8a0d6
commit
cf863664b7
@ -73,14 +73,27 @@ const _render = (props: Props, state: AccountState): React$Element<string> => {
|
||||
onChange={ token => props.addToken(token, account) }
|
||||
loadOptions={ input => props.loadTokens(input, account.network) }
|
||||
filterOptions= {
|
||||
(options: Array<NetworkToken>, search: string, values) => {
|
||||
return options.filter(o => {
|
||||
return !tokens.find(t => t.symbol === o.symbol);
|
||||
(options: Array<NetworkToken>, search: string, values: Array<NetworkToken>) => {
|
||||
return options.map(o => {
|
||||
const added = tokens.find(t => t.symbol === o.symbol);
|
||||
if (added) {
|
||||
return {
|
||||
...o,
|
||||
name: `${o.name} (Already added)`,
|
||||
disabled: true
|
||||
};
|
||||
} else {
|
||||
return o;
|
||||
}
|
||||
});
|
||||
|
||||
// return options.filter(o => {
|
||||
// return !tokens.find(t => t.symbol === o.symbol);
|
||||
// });
|
||||
}
|
||||
}
|
||||
valueKey="symbol"
|
||||
labelKey="symbol"
|
||||
labelKey="name"
|
||||
placeholder="Search for token"
|
||||
searchPromptText="Type token name or address"
|
||||
noResultsText="Token not found"
|
||||
|
@ -213,7 +213,7 @@ aside {
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
margin-right: 4px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
// .device-menu {
|
||||
|
Loading…
Reference in New Issue
Block a user