Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
import React, { PureComponent } from 'react';
import { accountsInfo$, defaultAccount$ } from '@parity/light.js';
import { Link, Redirect } from 'react-router-dom';
@light({
accountsInfo: accountsInfo$,
defaultAccount: defaultAccount$
})
handleGoToWhitelist = () => {
this.props.history.push('/whitelist');
const {
accountsInfo,
defaultAccount,
location: { state }
} = this.props;
// 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) {
// The address is defaultAccount, but if we are coming from the accounts
// page, then the address is also put inside the route state, for faster
// access.
const myAddress = (state && state.address) || defaultAccount;
myAddress &&
accountsInfo[myAddress] &&
accountsInfo[myAddress].name
<nav className='footer-nav'>
<div className='footer-nav_status'>
<div className='footer-nav_icons'>
<button className='button -tiny' onClick={this.handleGoToWhitelist}>
Add tokens