|
|
@ -15,6 +15,7 @@ function mapStateToProps (state) { |
|
|
|
userAddress: selectors.getSelectedAddress(state), |
|
|
|
userAddress: selectors.getSelectedAddress(state), |
|
|
|
tokenExchangeRates: state.metamask.tokenExchangeRates, |
|
|
|
tokenExchangeRates: state.metamask.tokenExchangeRates, |
|
|
|
ethToUSDRate: state.metamask.conversionRate, |
|
|
|
ethToUSDRate: state.metamask.conversionRate, |
|
|
|
|
|
|
|
sidebarOpen: state.appState.sidebarOpen, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -22,6 +23,7 @@ function mapDispatchToProps (dispatch) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
setSelectedToken: address => dispatch(actions.setSelectedToken(address)), |
|
|
|
setSelectedToken: address => dispatch(actions.setSelectedToken(address)), |
|
|
|
updateTokenExchangeRate: token => dispatch(actions.updateTokenExchangeRate(token)), |
|
|
|
updateTokenExchangeRate: token => dispatch(actions.updateTokenExchangeRate(token)), |
|
|
|
|
|
|
|
hideSidebar: () => dispatch(actions.hideSidebar()), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -52,6 +54,8 @@ TokenCell.prototype.render = function () { |
|
|
|
selectedTokenAddress, |
|
|
|
selectedTokenAddress, |
|
|
|
tokenExchangeRates, |
|
|
|
tokenExchangeRates, |
|
|
|
ethToUSDRate, |
|
|
|
ethToUSDRate, |
|
|
|
|
|
|
|
hideSidebar, |
|
|
|
|
|
|
|
sidebarOpen, |
|
|
|
// userAddress,
|
|
|
|
// userAddress,
|
|
|
|
} = props |
|
|
|
} = props |
|
|
|
|
|
|
|
|
|
|
@ -79,7 +83,10 @@ TokenCell.prototype.render = function () { |
|
|
|
className: `token-list-item ${selectedTokenAddress === address ? 'token-list-item--active' : ''}`, |
|
|
|
className: `token-list-item ${selectedTokenAddress === address ? 'token-list-item--active' : ''}`, |
|
|
|
// style: { cursor: network === '1' ? 'pointer' : 'default' },
|
|
|
|
// style: { cursor: network === '1' ? 'pointer' : 'default' },
|
|
|
|
// onClick: this.view.bind(this, address, userAddress, network),
|
|
|
|
// onClick: this.view.bind(this, address, userAddress, network),
|
|
|
|
onClick: () => setSelectedToken(address), |
|
|
|
onClick: () => { |
|
|
|
|
|
|
|
setSelectedToken(address) |
|
|
|
|
|
|
|
selectedTokenAddress !== address && sidebarOpen && hideSidebar() |
|
|
|
|
|
|
|
}, |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
|
|
|
|
|
|
|
|
h(Identicon, { |
|
|
|
h(Identicon, { |
|
|
|