diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-06 18:17:49 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-06 18:17:49 +0800 |
commit | f1fb9e10a06d1811d97f61b6369684979b7ecf70 (patch) | |
tree | 674886d99e6be7ea30b83f8f3811643beb792f07 /ui/app/components/token-cell.js | |
parent | 690ddf5ed75967537aa5513986146c262012832a (diff) | |
download | tangerine-wallet-browser-f1fb9e10a06d1811d97f61b6369684979b7ecf70.tar tangerine-wallet-browser-f1fb9e10a06d1811d97f61b6369684979b7ecf70.tar.gz tangerine-wallet-browser-f1fb9e10a06d1811d97f61b6369684979b7ecf70.tar.bz2 tangerine-wallet-browser-f1fb9e10a06d1811d97f61b6369684979b7ecf70.tar.lz tangerine-wallet-browser-f1fb9e10a06d1811d97f61b6369684979b7ecf70.tar.xz tangerine-wallet-browser-f1fb9e10a06d1811d97f61b6369684979b7ecf70.tar.zst tangerine-wallet-browser-f1fb9e10a06d1811d97f61b6369684979b7ecf70.zip |
Adding Token transaction detail screen
Diffstat (limited to 'ui/app/components/token-cell.js')
-rw-r--r-- | ui/app/components/token-cell.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/ui/app/components/token-cell.js b/ui/app/components/token-cell.js index a24e4e1ac..7fae67de6 100644 --- a/ui/app/components/token-cell.js +++ b/ui/app/components/token-cell.js @@ -1,10 +1,27 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits +const connect = require('react-redux').connect const Identicon = require('./identicon') const prefixForNetwork = require('../../lib/etherscan-prefix-for-network') +const selectors = require('../selectors') +const actions = require('../actions') -module.exports = TokenCell +function mapStateToProps (state) { + return { + network: state.metamask.network, + selectedTokenAddress: state.metamask.selectedTokenAddress, + userAddress: selectors.getSelectedAddress(state), + } +} + +function mapDispatchToProps (dispatch) { + return { + setSelectedToken: address => dispatch(actions.setSelectedToken(address)), + } +} + +module.exports = connect(mapStateToProps, mapDispatchToProps)(TokenCell) inherits(TokenCell, Component) function TokenCell () { @@ -18,13 +35,17 @@ TokenCell.prototype.render = function () { symbol, string, network, + setSelectedToken, + selectedTokenAddress, // userAddress, } = props return ( h('div.token-list-item', { - style: { cursor: network === '1' ? 'pointer' : 'default' }, + className: `token-list-item ${selectedTokenAddress ? 'token-list-item--active' : ''}`, + // style: { cursor: network === '1' ? 'pointer' : 'default' }, // onClick: this.view.bind(this, address, userAddress, network), + onClick: () => setSelectedToken(address), }, [ h(Identicon, { |