Display ETH balance in overlay account selector (#4588)

* Add account balance display from ParityBar

* Ellipsis with title

* Balance display in Dapp permissions

* Add balance to vault account selector

* Add key prop to accounts in Vault

* Fix failing test (missing redux prop)
This commit is contained in:
Jaco Greeff
2017-02-22 10:42:42 +01:00
committed by Gav Wood
parent fba4bda0ff
commit 0a85fc7a3e
9 changed files with 91 additions and 17 deletions

View File

@@ -80,7 +80,7 @@ class Dapps extends Component {
return (
<div>
<DappPermissions store={ this.permissionStore } />
<DappPermissions permissionStore={ this.permissionStore } />
<DappsVisible store={ this.store } />
<Actionbar
className={ styles.toolbar }

View File

@@ -48,6 +48,7 @@ class ParityBar extends Component {
};
static propTypes = {
balances: PropTypes.object,
dapp: PropTypes.bool,
externalLink: PropTypes.string,
pending: PropTypes.array
@@ -344,6 +345,8 @@ class ParityBar extends Component {
}
renderAccount = (account) => {
const { balances } = this.props;
const balance = balances[account.address];
const makeDefaultAccount = () => {
this.toggleAccountsDisplay();
return this.accountStore
@@ -358,6 +361,7 @@ class ParityBar extends Component {
>
<AccountCard
account={ account }
balance={ balance }
className={
account.default
? styles.selected
@@ -653,9 +657,11 @@ class ParityBar extends Component {
}
function mapStateToProps (state) {
const { balances } = state.balances;
const { pending } = state.signer;
return {
balances,
pending
};
}

View File

@@ -31,7 +31,14 @@ function createRedux (state = {}) {
store = {
dispatch: sinon.stub(),
subscribe: sinon.stub(),
getState: () => Object.assign({ signer: { pending: [] } }, state)
getState: () => Object.assign({
balances: {
balances: {}
},
signer: {
pending: []
}
}, state)
};
return store;