diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-07-15 04:47:07 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-07-18 04:38:14 +0800 |
commit | d19c42fcaeea933793ed459ab5248b42811a0498 (patch) | |
tree | 345394ef9704fa0afd0d713e4d9ef052bcc943fc /ui/app/components/pages/confirm-approve | |
parent | e9a8c24cc4d26e33380a33e87e80952918339ad7 (diff) | |
download | tangerine-wallet-browser-d19c42fcaeea933793ed459ab5248b42811a0498.tar tangerine-wallet-browser-d19c42fcaeea933793ed459ab5248b42811a0498.tar.gz tangerine-wallet-browser-d19c42fcaeea933793ed459ab5248b42811a0498.tar.bz2 tangerine-wallet-browser-d19c42fcaeea933793ed459ab5248b42811a0498.tar.lz tangerine-wallet-browser-d19c42fcaeea933793ed459ab5248b42811a0498.tar.xz tangerine-wallet-browser-d19c42fcaeea933793ed459ab5248b42811a0498.tar.zst tangerine-wallet-browser-d19c42fcaeea933793ed459ab5248b42811a0498.zip |
Add fallback when no function found, fix network colors, add fiat values for tokens with contract exchange rates
Diffstat (limited to 'ui/app/components/pages/confirm-approve')
-rw-r--r-- | ui/app/components/pages/confirm-approve/confirm-approve.component.js | 21 | ||||
-rw-r--r-- | ui/app/components/pages/confirm-approve/confirm-approve.container.js | 19 |
2 files changed, 7 insertions, 33 deletions
diff --git a/ui/app/components/pages/confirm-approve/confirm-approve.component.js b/ui/app/components/pages/confirm-approve/confirm-approve.component.js index d775b0362..10f06e565 100644 --- a/ui/app/components/pages/confirm-approve/confirm-approve.component.js +++ b/ui/app/components/pages/confirm-approve/confirm-approve.component.js @@ -1,29 +1,18 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import ConfirmTransactionBase from '../confirm-transaction-base' +import ConfirmTokenTransactionBase from '../confirm-token-transaction-base' export default class ConfirmApprove extends Component { - static contextTypes = { - t: PropTypes.func, - } - static propTypes = { - tokenAddress: PropTypes.string, - toAddress: PropTypes.string, - tokenAmount: PropTypes.string, - tokenSymbol: PropTypes.string, + tokenAmount: PropTypes.number, } render () { - const { toAddress, tokenAddress, tokenAmount, tokenSymbol } = this.props + const { tokenAmount } = this.props return ( - <ConfirmTransactionBase - toAddress={toAddress} - identiconAddress={tokenAddress} - title={`${tokenAmount} ${tokenSymbol}`} - warning={`By approving this action, you grant permission for this contract to spend up to ${tokenAmount} of your ${tokenSymbol}.`} - hideSubtitle + <ConfirmTokenTransactionBase + tokenAmount={tokenAmount} /> ) } diff --git a/ui/app/components/pages/confirm-approve/confirm-approve.container.js b/ui/app/components/pages/confirm-approve/confirm-approve.container.js index 040e499ae..249175e17 100644 --- a/ui/app/components/pages/confirm-approve/confirm-approve.container.js +++ b/ui/app/components/pages/confirm-approve/confirm-approve.container.js @@ -1,27 +1,12 @@ import { connect } from 'react-redux' import ConfirmApprove from './confirm-approve.component' +import { approveTokenAmountAndToAddressSelector } from '../../../selectors/confirm-transaction' const mapStateToProps = state => { - const { confirmTransaction } = state - const { - tokenData = {}, - txData: { txParams: { to: tokenAddress } = {} } = {}, - tokenProps: { tokenSymbol } = {}, - } = confirmTransaction - const { params = [] } = tokenData - - let toAddress = '' - let tokenAmount = '' - - if (params && params.length === 2) { - [{ value: toAddress }, { value: tokenAmount }] = params - } + const { tokenAmount } = approveTokenAmountAndToAddressSelector(state) return { - toAddress, - tokenAddress, tokenAmount, - tokenSymbol, } } |