Commit a9b3ae6e authored by Luke Schoen's avatar Luke Schoen
Browse files

refactor: Replace url with onClick

parent e423b8b8
Pipeline #28555 passed with stage
in 1 minute and 50 seconds
......@@ -14,10 +14,6 @@ import withAccount from '../utils/withAccount';
@withRouter
@withAccount
class Tokens extends PureComponent {
handleGoToLink = url => {
this.props.history.push(url);
};
isParitySignerAccount = () => {
const {
account: { type }
......@@ -28,18 +24,19 @@ class Tokens extends PureComponent {
menuItems = () => {
const {
account: { address }
account: { address },
history
} = this.props;
const backupAccountItem = {
name: 'Backup Account',
url: `/backup/${address}`
onClick: () => history.push(`/backup/${address}`)
};
let menuItems = [
{
name: 'Add tokens',
url: `/whitelist/${address}`
name: 'Add Tokens',
onClick: () => history.push(`/whitelist/${address}`)
}
];
......@@ -72,7 +69,6 @@ class Tokens extends PureComponent {
className='popup-menu-account'
horizontalOffset={1}
menuItems={this.menuItems()}
onItemClick={this.handleGoToLink}
size='small'
trigger={<Clickable className='icon -menu' />}
/>
......
......@@ -7,7 +7,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Popup as SUIPopup } from 'semantic-ui-react';
export const MenuPopup = ({ menuItems, onItemClick, ...otherProps }) => (
export const MenuPopup = ({ menuItems, ...otherProps }) => (
<SUIPopup {...otherProps}>
<div className='popup-screen'>
<SUIPopup.Content>
......@@ -16,7 +16,7 @@ export const MenuPopup = ({ menuItems, onItemClick, ...otherProps }) => (
<div
className='popup-screen_item'
key={item.name}
onClick={() => onItemClick(item.url)}
onClick={() => item.onClick()}
>
{item.name}
</div>
......@@ -39,7 +39,6 @@ MenuPopup.propTypes = {
horizontalOffset: PropTypes.number,
menuItems: PropTypes.array.isRequired,
on: PropTypes.string,
onItemClick: PropTypes.func,
size: PropTypes.string,
trigger: PropTypes.node
};
Supports Markdown
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