1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/app/components/transaction-view-balance/transaction-view-balance.container.js
2018-08-29 23:13:25 -03:00

32 lines
935 B
JavaScript

import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
import TransactionViewBalance from './transaction-view-balance.component'
import { getSelectedToken, getSelectedAddress, getSelectedTokenAssetImage } from '../../selectors'
import { showModal } from '../../actions'
const mapStateToProps = state => {
const selectedAddress = getSelectedAddress(state)
const { metamask: { network, accounts } } = state
const account = accounts[selectedAddress]
const { balance } = account
return {
selectedToken: getSelectedToken(state),
network,
balance,
assetImage: getSelectedTokenAssetImage(state),
}
}
const mapDispatchToProps = dispatch => {
return {
showDepositModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER' })),
}
}
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps)
)(TransactionViewBalance)