diff options
author | Dan <danjm.com@gmail.com> | 2018-06-20 23:48:23 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-07-16 23:28:32 +0800 |
commit | b3d78ed8a1fbea059344b04416fb21bdb1b73f86 (patch) | |
tree | 6a2d8f6dda690961331c9bcbf5e2c6bf7102bced /ui/app/components/send/send.container.js | |
parent | f31e87dcd5cec09e81c741e311efc3793c9d9b98 (diff) | |
download | tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar.gz tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar.bz2 tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar.lz tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar.xz tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.tar.zst tangerine-wallet-browser-b3d78ed8a1fbea059344b04416fb21bdb1b73f86.zip |
Remove send_ directory, revert to just having send
Revert accidentally changed constants.
Require defaults in ens-input, gas-fee-display and confirm screens.
Diffstat (limited to 'ui/app/components/send/send.container.js')
-rw-r--r-- | ui/app/components/send/send.container.js | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/ui/app/components/send/send.container.js b/ui/app/components/send/send.container.js new file mode 100644 index 000000000..44ebd2792 --- /dev/null +++ b/ui/app/components/send/send.container.js @@ -0,0 +1,93 @@ +import { connect } from 'react-redux' +import SendEther from './send.component' +import { withRouter } from 'react-router-dom' +import { compose } from 'recompose' +import { + getAmountConversionRate, + getBlockGasLimit, + getConversionRate, + getCurrentNetwork, + getGasLimit, + getGasPrice, + getGasTotal, + getPrimaryCurrency, + getRecentBlocks, + getSelectedAddress, + getSelectedToken, + getSelectedTokenContract, + getSelectedTokenToFiatRate, + getSendAmount, + getSendEditingTransactionId, + getSendFromObject, + getSendTo, + getTokenBalance, +} from './send.selectors' +import { + updateSendTokenBalance, + updateGasData, + setGasTotal, +} from '../../actions' +import { + resetSendState, + updateSendErrors, +} from '../../ducks/send.duck' +import { + calcGasTotal, +} from './send.utils.js' + +module.exports = compose( + withRouter, + connect(mapStateToProps, mapDispatchToProps) +)(SendEther) + +function mapStateToProps (state) { + return { + amount: getSendAmount(state), + amountConversionRate: getAmountConversionRate(state), + blockGasLimit: getBlockGasLimit(state), + conversionRate: getConversionRate(state), + editingTransactionId: getSendEditingTransactionId(state), + from: getSendFromObject(state), + gasLimit: getGasLimit(state), + gasPrice: getGasPrice(state), + gasTotal: getGasTotal(state), + network: getCurrentNetwork(state), + primaryCurrency: getPrimaryCurrency(state), + recentBlocks: getRecentBlocks(state), + selectedAddress: getSelectedAddress(state), + selectedToken: getSelectedToken(state), + to: getSendTo(state), + tokenBalance: getTokenBalance(state), + tokenContract: getSelectedTokenContract(state), + tokenToFiatRate: getSelectedTokenToFiatRate(state), + } +} + +function mapDispatchToProps (dispatch) { + return { + updateAndSetGasTotal: ({ + blockGasLimit, + editingTransactionId, + gasLimit, + gasPrice, + recentBlocks, + selectedAddress, + selectedToken, + to, + value, + }) => { + !editingTransactionId + ? dispatch(updateGasData({ recentBlocks, selectedAddress, selectedToken, blockGasLimit, to, value })) + : dispatch(setGasTotal(calcGasTotal(gasLimit, gasPrice))) + }, + updateSendTokenBalance: ({ selectedToken, tokenContract, address }) => { + dispatch(updateSendTokenBalance({ + selectedToken, + tokenContract, + address, + })) + }, + updateSendErrors: newError => dispatch(updateSendErrors(newError)), + resetSendState: () => dispatch(resetSendState()), + } +} |