You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
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,
|
|
getNativeCurrency,
|
|
getSelectedTokenAssetImage,
|
|
getMetaMaskAccounts,
|
|
} from '../../selectors'
|
|
import { showModal } from '../../actions'
|
|
|
|
const mapStateToProps = state => {
|
|
const selectedAddress = getSelectedAddress(state)
|
|
const { metamask: { network } } = state
|
|
const accounts = getMetaMaskAccounts(state)
|
|
const account = accounts[selectedAddress]
|
|
const { balance } = account
|
|
|
|
return {
|
|
selectedToken: getSelectedToken(state),
|
|
network,
|
|
balance,
|
|
nativeCurrency: getNativeCurrency(state),
|
|
assetImage: getSelectedTokenAssetImage(state),
|
|
}
|
|
}
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
return {
|
|
showDepositModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER' })),
|
|
}
|
|
}
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps)
|
|
)(TransactionViewBalance)
|
|
|