Commit 6f34f866 authored by Amaury Martiny's avatar Amaury Martiny
Browse files

Fix wording and lint

parent e818d843
......@@ -21,7 +21,7 @@ class Tokens extends PureComponent {
this.props.history.push('/whitelist');
};
render() {
render () {
const {
accountsInfo,
defaultAccount,
......@@ -31,7 +31,7 @@ class Tokens extends PureComponent {
// If the accountsInfo object is empty (i.e. no accounts), then we redirect
// to the accounts page to create an account
if (accountsInfo && !Object.keys(accountsInfo).length) {
return <Redirect to="/accounts/new" />;
return <Redirect to='/accounts/new' />;
}
// The address is defaultAccount, but if we are coming from the accounts
......@@ -51,7 +51,7 @@ class Tokens extends PureComponent {
accountsInfo[myAddress].name
}
left={
<Link to="/accounts" className="icon -back">
<Link to='/accounts' className='icon -back'>
Back
</Link>
}
......@@ -59,13 +59,13 @@ class Tokens extends PureComponent {
<TokensList />
<nav className="footer-nav">
<div className="footer-nav_status">
<nav className='footer-nav'>
<div className='footer-nav_status'>
<Health />
</div>
<div className="footer-nav_icons">
<button className="button -tiny" onClick={this.handleGoToWhitelist}>
View my tokens
<div className='footer-nav_icons'>
<button className='button -tiny' onClick={this.handleGoToWhitelist}>
Add tokens
</button>
</div>
</nav>
......
......@@ -40,21 +40,21 @@ class Whitelist extends Component {
const matches = db
? db.filter(
({ name, symbol }) =>
name.toLowerCase().includes(search.toLowerCase()) ||
({ name, symbol }) =>
name.toLowerCase().includes(search.toLowerCase()) ||
symbol.toLowerCase().includes(search.toLowerCase())
)
)
: [];
this.setState({ matches });
}, 500);
componentDidMount() {
componentDidMount () {
if (this.props.chainName) {
this.fetchTokensDb();
}
}
componentDidUpdate(prevProps) {
componentDidUpdate (prevProps) {
if (this.props.chainName && !prevProps.chainName) {
this.fetchTokensDb();
}
......@@ -95,40 +95,40 @@ class Whitelist extends Component {
this.calculateMatches();
};
render() {
render () {
const { matches, search } = this.state;
return (
<div>
<Header
left={
<Link to="/tokens" className="icon -close">
<Link to='/tokens' className='icon -close'>
Close
</Link>
}
title={<h1>My tokens</h1>}
/>
<div className="window_content">
<div className="box -padded">
<div className="search-form">
<div className='window_content'>
<div className='box -padded'>
<div className='search-form'>
<input
onChange={this.handleSearch}
placeholder="Find token by name or symbol"
placeholder='Find token by name or symbol'
value={search}
type="text"
type='text'
/>
<button
onClick={this.handleClear}
className="button -icon -clear"
className='button -icon -clear'
disabled={!search.length}
>
Clear
</button>
</div>
</div>
<div className="box -scroller">
<ul className="list -tokens">
<div className='box -scroller'>
<ul className='list -tokens'>
{matches.map(token => (
<NewTokenItem key={token.address} token={token} />
))}
......@@ -136,8 +136,8 @@ class Whitelist extends Component {
</div>
</div>
<nav className="footer-nav">
<div className="footer-nav_status">
<nav className='footer-nav'>
<div className='footer-nav_status'>
<Health />
</div>
</nav>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment