// Copyright 2015-2018 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$, withoutLoading } from '@parity/light.js'; import { inject, observer } from 'mobx-react'; import light from '@parity/light.js-react'; import Health from '../../Health'; import Feedback from './Feedback'; import withAccountsInfo from '../../utils/withAccountsInfo'; @withAccountsInfo @inject('createAccountStore', 'parityStore') @light({ chainId: () => chainId$().pipe(withoutLoading()) }) @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={

Accounts

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

Nothing here yet!

Click the + icon to add a new account.

)}
); } } export default AccountsList;