diff options
author | Thomas <thomas.b.huang@gmail.com> | 2018-05-04 05:10:26 +0800 |
---|---|---|
committer | Thomas <thomas.b.huang@gmail.com> | 2018-05-04 05:10:26 +0800 |
commit | f900821a425ce97695034b3445effe1bbaf4a9a5 (patch) | |
tree | f426762d58f31b3c527491e7e8ba25dd11936f3a /ui/app/components/shapeshift-form.js | |
parent | 9bba97a676b47667abdd7b020cebd56a0f3b96c7 (diff) | |
parent | 096851d091385ee786ab1374e83aaf6a1aa7cbce (diff) | |
download | tangerine-wallet-browser-f900821a425ce97695034b3445effe1bbaf4a9a5.tar.gz tangerine-wallet-browser-f900821a425ce97695034b3445effe1bbaf4a9a5.tar.zst tangerine-wallet-browser-f900821a425ce97695034b3445effe1bbaf4a9a5.zip |
Merge branch 'develop' into e2e-tests
Diffstat (limited to 'ui/app/components/shapeshift-form.js')
-rw-r--r-- | ui/app/components/shapeshift-form.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/app/components/shapeshift-form.js b/ui/app/components/shapeshift-form.js index fd4a80a4a..22ab64426 100644 --- a/ui/app/components/shapeshift-form.js +++ b/ui/app/components/shapeshift-form.js @@ -55,6 +55,10 @@ function ShapeshiftForm () { } } +ShapeshiftForm.prototype.getCoinPair = function () { + return `${this.state.depositCoin.toUpperCase()}_ETH` +} + ShapeshiftForm.prototype.componentWillMount = function () { this.props.shapeShiftSubview() } @@ -120,14 +124,12 @@ ShapeshiftForm.prototype.renderMetadata = function (label, value) { } ShapeshiftForm.prototype.renderMarketInfo = function () { - const { depositCoin } = this.state - const coinPair = `${depositCoin}_eth` const { tokenExchangeRates } = this.props const { limit, rate, minimum, - } = tokenExchangeRates[coinPair] || {} + } = tokenExchangeRates[this.getCoinPair()] || {} return h('div.shapeshift-form__metadata', {}, [ @@ -172,10 +174,9 @@ ShapeshiftForm.prototype.renderQrCode = function () { ShapeshiftForm.prototype.render = function () { const { coinOptions, btnClass, warning } = this.props - const { depositCoin, errorMessage, showQrCode, depositAddress } = this.state - const coinPair = `${depositCoin}_eth` + const { errorMessage, showQrCode, depositAddress } = this.state const { tokenExchangeRates } = this.props - const token = tokenExchangeRates[coinPair] + const token = tokenExchangeRates[this.getCoinPair()] return h('div.shapeshift-form-wrapper', [ showQrCode |