|
|
|
@ -42,14 +42,21 @@ AccountDetailScreen.prototype.render = function() { |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
|
|
h('.account-detail-section.flex-column.flex-grow', { |
|
|
|
|
h('.account-detail-section.flex-column.flex-grow', [ |
|
|
|
|
|
|
|
|
|
// identicon, label, balance, etc
|
|
|
|
|
h('.account-data-subsection.flex-column.flex-grow', { |
|
|
|
|
style: { |
|
|
|
|
width: 330, |
|
|
|
|
marginTop: 28, |
|
|
|
|
margin: '0 20px', |
|
|
|
|
}, |
|
|
|
|
}, [ |
|
|
|
|
|
|
|
|
|
h('.flex-row.flex-space-between', [ |
|
|
|
|
// header - identicon + nav
|
|
|
|
|
h('.flex-row.flex-space-between', { |
|
|
|
|
style: { |
|
|
|
|
marginTop: 28, |
|
|
|
|
}, |
|
|
|
|
}, [ |
|
|
|
|
|
|
|
|
|
// invisible placeholder for later
|
|
|
|
|
h('i.fa.fa-users.fa-lg.color-orange', { |
|
|
|
@ -73,6 +80,7 @@ AccountDetailScreen.prototype.render = function() { |
|
|
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
|
|
// account label
|
|
|
|
|
h('h2.font-medium.color-forest.flex-center', { |
|
|
|
|
style: { |
|
|
|
|
paddingTop: 8, |
|
|
|
@ -80,6 +88,7 @@ AccountDetailScreen.prototype.render = function() { |
|
|
|
|
}, |
|
|
|
|
}, identity && identity.name), |
|
|
|
|
|
|
|
|
|
// address and getter actions
|
|
|
|
|
h('.flex-row.flex-space-between', { |
|
|
|
|
style: { |
|
|
|
|
marginBottom: 16, |
|
|
|
@ -106,13 +115,14 @@ AccountDetailScreen.prototype.render = function() { |
|
|
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
|
|
// balance + send
|
|
|
|
|
h('.flex-row.flex-space-between', [ |
|
|
|
|
|
|
|
|
|
h('div', { |
|
|
|
|
style: { |
|
|
|
|
lineHeight: '50px', |
|
|
|
|
}, |
|
|
|
|
}, formatBalance(account.balance)), |
|
|
|
|
}, formatBalance(account && account.balance)), |
|
|
|
|
|
|
|
|
|
h('button', { |
|
|
|
|
onClick: () => this.props.dispatch(actions.showSendPage()), |
|
|
|
@ -120,7 +130,11 @@ AccountDetailScreen.prototype.render = function() { |
|
|
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
|
|
// subview (tx history, pk export confirm)
|
|
|
|
|
h(ReactCSSTransitionGroup, { |
|
|
|
|
className: 'css-transition-group', |
|
|
|
|
transitionName: 'main', |
|
|
|
|
transitionEnterTimeout: 300, |
|
|
|
|
transitionLeaveTimeout: 300, |
|
|
|
@ -155,15 +169,17 @@ AccountDetailScreen.prototype.transactionList = function() { |
|
|
|
|
var state = this.props |
|
|
|
|
var transactions = state.transactions |
|
|
|
|
|
|
|
|
|
return transactionList(transactions |
|
|
|
|
// only transactions that have a hash
|
|
|
|
|
.filter(tx => tx.hash) |
|
|
|
|
var txsToRender = transactions |
|
|
|
|
// only transactions that are from the current address
|
|
|
|
|
.filter(tx => tx.txParams.from === state.address) |
|
|
|
|
// only transactions that are on the current network
|
|
|
|
|
.filter(tx => tx.txParams.metamaskNetworkId === state.networkVersion) |
|
|
|
|
// only transactions that have a hash
|
|
|
|
|
.filter(tx => tx.hash) |
|
|
|
|
// sort by recency
|
|
|
|
|
.sort((a, b) => b.time - a.time), state.networkVersion) |
|
|
|
|
.sort((a, b) => b.time - a.time) |
|
|
|
|
|
|
|
|
|
return transactionList(txsToRender, state.networkVersion) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AccountDetailScreen.prototype.navigateToAccounts = function(event){ |
|
|
|
|