import React, { Component } from 'react' import PropTypes from 'prop-types' import { DEFAULT_ROUTE, ADD_TOKEN_ROUTE } from '../../../routes' import Button from '../../button' import Identicon from '../../../components/identicon' import TokenBalance from './token-balance' export default class ConfirmAddToken extends Component { static contextTypes = { t: PropTypes.func, } static propTypes = { history: PropTypes.object, clearPendingTokens: PropTypes.func, addTokens: PropTypes.func, pendingTokens: PropTypes.object, } componentDidMount () { const { pendingTokens = {}, history } = this.props if (Object.keys(pendingTokens).length === 0) { history.push(DEFAULT_ROUTE) } } getTokenName (name, symbol) { return typeof name === 'undefined' ? symbol : `${name} (${symbol})` } render () { const { history, addTokens, clearPendingTokens, pendingTokens } = this.props return (