|
|
@ -20,15 +20,21 @@ const Identicon = require('./identicon') |
|
|
|
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxView) |
|
|
|
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxView) |
|
|
|
|
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|
function mapStateToProps (state) { |
|
|
|
|
|
|
|
const sidebarOpen = state.appState.sidebarOpen |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const identities = state.metamask.identities |
|
|
|
|
|
|
|
const accounts = state.metamask.accounts |
|
|
|
|
|
|
|
const selectedAddress = state.metamask.selectedAddress || Object.keys(accounts)[0] |
|
|
|
|
|
|
|
const checksumAddress = selectedAddress && ethUtil.toChecksumAddress(selectedAddress) |
|
|
|
|
|
|
|
const identity = identities[selectedAddress] |
|
|
|
|
|
|
|
const account = accounts[selectedAddress] |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
sidebarOpen: state.appState.sidebarOpen, |
|
|
|
sidebarOpen, |
|
|
|
identities: state.metamask.identities, |
|
|
|
selectedAddress, |
|
|
|
accounts: state.metamask.accounts, |
|
|
|
checksumAddress, |
|
|
|
address: state.metamask.selectedAddress, |
|
|
|
identity, |
|
|
|
transactions: state.metamask.selectedAddressTxList || [], |
|
|
|
account, |
|
|
|
shapeShiftTxList: state.metamask.shapeShiftTxList, |
|
|
|
|
|
|
|
conversionRate: state.metamask.conversionRate, |
|
|
|
|
|
|
|
currentCurrency: state.metamask.currentCurrency, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -47,14 +53,7 @@ function TxView () { |
|
|
|
|
|
|
|
|
|
|
|
TxView.prototype.render = function () { |
|
|
|
TxView.prototype.render = function () { |
|
|
|
|
|
|
|
|
|
|
|
var props = this.props |
|
|
|
const { selectedAddress, identity, account } = this.props |
|
|
|
var selected = props.address || Object.keys(props.accounts)[0] |
|
|
|
|
|
|
|
var checksumAddress = selected && ethUtil.toChecksumAddress(selected) |
|
|
|
|
|
|
|
var identity = props.identities[selected] |
|
|
|
|
|
|
|
var account = props.accounts[selected] |
|
|
|
|
|
|
|
const { conversionRate, currentCurrency, transactions } = props |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(transactions) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return h('div.tx-view.flex-column', { |
|
|
|
return h('div.tx-view.flex-column', { |
|
|
|
style: {}, |
|
|
|
style: {}, |
|
|
@ -63,7 +62,7 @@ TxView.prototype.render = function () { |
|
|
|
h('div.flex-row.phone-visible', { |
|
|
|
h('div.flex-row.phone-visible', { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
margin: '1em 0.9em', |
|
|
|
margin: '1em 0.9em', |
|
|
|
alignItems: 'center' |
|
|
|
alignItems: 'center', |
|
|
|
}, |
|
|
|
}, |
|
|
|
onClick: () => { |
|
|
|
onClick: () => { |
|
|
|
this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar() |
|
|
|
this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar() |
|
|
@ -84,7 +83,7 @@ TxView.prototype.render = function () { |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
h(Identicon, { |
|
|
|
h(Identicon, { |
|
|
|
diameter: 24, |
|
|
|
diameter: 24, |
|
|
|
address: selected, |
|
|
|
address: selectedAddress, |
|
|
|
}), |
|
|
|
}), |
|
|
|
]), |
|
|
|
]), |
|
|
|
|
|
|
|
|
|
|
@ -104,8 +103,6 @@ TxView.prototype.render = function () { |
|
|
|
|
|
|
|
|
|
|
|
h(BalanceComponent, { |
|
|
|
h(BalanceComponent, { |
|
|
|
balanceValue: account && account.balance, |
|
|
|
balanceValue: account && account.balance, |
|
|
|
conversionRate, |
|
|
|
|
|
|
|
currentCurrency, |
|
|
|
|
|
|
|
style: {}, |
|
|
|
style: {}, |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|