// Copyright 2015-2019 Parity Technologies (UK) Ltd. // This file is part of Parity. // // SPDX-License-Identifier: BSD-3-Clause import React, { Component } from 'react'; import { AccountCard, Clickable, Header } from 'fether-ui'; import { chainId$ } from '@parity/light.js'; import { inject, observer } from 'mobx-react'; import light from '@parity/light.js-react'; import i18n, { packageNS } from '../../i18n'; import RequireHealthOverlay from '../../RequireHealthOverlay'; import Health from '../../Health'; import withAccountsInfo from '../../utils/withAccountsInfo'; import Feedback from './Feedback'; @withAccountsInfo @inject('createAccountStore', 'parityStore') @light({ chainId: () => chainId$() }) @observer class AccountsList extends Component { handleClick = ({ currentTarget: { dataset: { address } } }) => { const { history } = this.props; history.push(`/tokens/${address}`); }; handleCreateAccount = () => { this.props.createAccountStore.setIsImport(false); this.props.history.push('/accounts/new'); }; render () { const { accountsInfo, chainId } = this.props; const accountsList = Object.keys(accountsInfo).filter( key => !accountsInfo[key].chainId || accountsInfo[key].chainId === parseInt(chainId, 10) ); const accountsListLength = accountsList && accountsList.length; return (
} title={

{i18n.t(`${packageNS}:accounts_list.header`)}

} />
{accountsListLength ? (
    {accountsList.map(address => (
  • ))}
) : (

{i18n.t(`${packageNS}:accounts_list.hint.none`)}

{i18n.t(`${packageNS}:accounts_list.hint.exist`)}

)}
); } } export default AccountsList;