// Copyright 2015-2018 Parity Technologies (UK) Ltd. // This file is part of Parity. // // SPDX-License-Identifier: MIT import React, { Component } from 'react'; import { accountsInfo$ } from '@parity/light.js'; import Blockies from 'react-blockies'; import { Header } from 'light-ui'; import { inject, observer } from 'mobx-react'; import light from 'light-hoc'; import Health from '../../Health'; @light({ accountsInfo: accountsInfo$ }) @inject('createAccountStore', 'parityStore') @observer class AccountsList extends Component { handleClick = ({ currentTarget: { dataset: { address } } }) => { const { history, parityStore: { api } } = this.props; // Set default account to the clicked one, and go to Tokens on complete // TODO Not 100% clean, I don't want any api.abc.method() in any React // component. api.parity .setNewDappsDefaultAddress(address) .then(() => history.push('/tokens')) .catch(() => {}); // TODO do what? }; handleCreateAccount = () => { this.props.createAccountStore.setIsImporting(false); this.props.history.push('/accounts/new'); }; render () { const { accountsInfo } = this.props; return (
Accounts} right={ New account } />
{accountsInfo ? (
    {Object.keys(accountsInfo).map(address => (
  • {accountsInfo[address].name}
    {address}
  • ))}
) : (

Loading…

)}
); } } export default AccountsList;