Enabling search by name in Token List

This commit is contained in:
Adolfo Panizo 2018-11-05 21:55:53 +01:00
parent 99b3eb8f04
commit ef2f1c991e
1 changed files with 4 additions and 1 deletions

View File

@ -38,7 +38,10 @@ type State = {
}
const filterBy = (filter: string, tokens: List<Token>): List<Token> =>
tokens.filter((token: Token) => !filter || token.get('symbol').toLowerCase().startsWith(filter.toLowerCase()))
tokens.filter((token: Token) => !filter ||
token.get('symbol').toLowerCase().includes(filter.toLowerCase()) ||
token.get('name').toLowerCase().includes(filter.toLowerCase()))
class Tokens extends React.Component<Props, State> {
state = {