Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
import React, { PureComponent } from 'react';
import { AccountHeader, Clickable, MenuPopup } from 'fether-ui';
import { Link, withRouter } from 'react-router-dom';
import Health from '../Health';
import TokensList from './TokensList';
import withAccount from '../utils/withAccount';
Axel Chalon
committed
@withRouter
handleGoToLink = url => {
this.props.history.push(url);
isParitySignerAccount = () => {
const {
account: { type }
} = this.props;
return type === 'signer';
};
const {
account: { address }
} = this.props;
const backupAccountItem = {
name: 'Backup Account',
url: `/backup/${address}`
};
let menuItems = [
url: `/whitelist/${address}`
if (this.isParitySignerAccount() === false) {
menuItems = [backupAccountItem, ...menuItems];
}
return menuItems;
const {
account: { address, name, type }
} = this.props;
Luke Schoen
committed
<div className='tokens'>
<MenuPopup
className='popup-menu-account'
horizontalOffset={1}
menuItems={this.menuItems()}
onItemClick={this.handleGoToLink}
size='small'
trigger={<Clickable className='icon -menu' />}