Display contract block creation (#4069)
* Add contract block creation to metadata * Display mined block for contract on Contracts view * Better use of Summary for Accounts * Add sorted by mined block for contracts * Proper Block Number sort // display in contract page * PR Grumble * Linting issues
This commit is contained in:
committed by
Jaco Greeff
parent
71e6e24a1f
commit
cf0a20f08b
@@ -17,6 +17,9 @@
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import BigNumber from 'bignumber.js';
|
||||
|
||||
import ActionDelete from 'material-ui/svg-icons/action/delete';
|
||||
import AvPlayArrow from 'material-ui/svg-icons/av/play-arrow';
|
||||
import ContentCreate from 'material-ui/svg-icons/content/create';
|
||||
@@ -136,7 +139,9 @@ class Contract extends Component {
|
||||
account={ account }
|
||||
balance={ balance }
|
||||
isContract
|
||||
/>
|
||||
>
|
||||
{ this.renderBlockNumber(account.meta) }
|
||||
</Header>
|
||||
|
||||
<Queries
|
||||
accountsInfo={ accountsInfo }
|
||||
@@ -156,6 +161,28 @@ class Contract extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
renderBlockNumber (meta = {}) {
|
||||
const { blockNumber } = meta;
|
||||
|
||||
if (!blockNumber) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const formattedBlockNumber = (new BigNumber(blockNumber)).toFormat();
|
||||
|
||||
return (
|
||||
<div className={ styles.blockNumber }>
|
||||
<FormattedMessage
|
||||
id='contract.minedBlock'
|
||||
defaultMessage='Mined at block #{blockNumber}'
|
||||
values={ {
|
||||
blockNumber: formattedBlockNumber
|
||||
} }
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderDetails (contract) {
|
||||
const { showDetailsDialog } = this.state;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user