1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Remove shapeshift deposit form (#6746)

Closes #6478
This commit is contained in:
Mark Stacey 2019-06-24 13:47:48 -03:00 committed by Dan J Miller
parent a257a73172
commit 313def1ce2
28 changed files with 2 additions and 434 deletions

View File

@ -252,10 +252,6 @@
"depositBTC": { "depositBTC": {
"message": "Vložte BTC na níže uvedenou adresu:" "message": "Vložte BTC na níže uvedenou adresu:"
}, },
"depositCoin": {
"message": "Vložte $1 na níže uvedenou adresu",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "Vložit Eth" "message": "Vložit Eth"
}, },

View File

@ -249,10 +249,6 @@
"depositBTC": { "depositBTC": {
"message": "Zahle dein BTC in die unten stehende Adresse ein:" "message": "Zahle dein BTC in die unten stehende Adresse ein:"
}, },
"depositCoin": {
"message": "Zahle deine $1 in die unten stehende Adresse ein",
"description": "Teilt dem Benutzer mit welchen Token er beim Einzahlen mit Shapeshift ausgewählt hat"
},
"depositEth": { "depositEth": {
"message": "Eth kaufen" "message": "Eth kaufen"
}, },

View File

@ -466,10 +466,6 @@
"depositBTC": { "depositBTC": {
"message": "Deposit your BTC to the address below:" "message": "Deposit your BTC to the address below:"
}, },
"depositCoin": {
"message": "Deposit your $1 to the address below",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "Deposit Eth" "message": "Deposit Eth"
}, },

View File

@ -264,10 +264,6 @@
"depositBTC": { "depositBTC": {
"message": "Deposita tus BTC a la dirección de abajo:" "message": "Deposita tus BTC a la dirección de abajo:"
}, },
"depositCoin": {
"message": "Deposita tu $1 a la dirección de abajo",
"description": "Informa al usuario que moneda ha elegido para depositar en shapeshift"
},
"depositEth": { "depositEth": {
"message": "Depositar Ether" "message": "Depositar Ether"
}, },

View File

@ -330,10 +330,6 @@
"depositBTC": { "depositBTC": {
"message": "Déposez vos BTC à l'adresse ci-dessous:" "message": "Déposez vos BTC à l'adresse ci-dessous:"
}, },
"depositCoin": {
"message": "Déposer votre $1 à l'adresse ci-dessous",
"description": "Indique à l'utilisateur quelle monnaie il a choisi de déposer avec Shapeshift"
},
"depositEth": { "depositEth": {
"message": "Déposer Eth" "message": "Déposer Eth"
}, },

View File

@ -240,10 +240,6 @@
"depositBTC": { "depositBTC": {
"message": "नीचे दिए गए पते पर अपना बीटीसी जमा करें:" "message": "नीचे दिए गए पते पर अपना बीटीसी जमा करें:"
}, },
"depositCoin": {
"message": "नीचे दिए गए पते पर अपना $1 जमा करें",
"description": "उपयोगकर्ता को बताता है कि उन्होंने सिक्का के साथ जमा करने के लिए किस सिक्का का चयन किया है"
},
"depositEth": { "depositEth": {
"message": "Eth जमाआर्थ" "message": "Eth जमाआर्थ"
}, },

View File

@ -336,10 +336,6 @@
"depositBTC": { "depositBTC": {
"message": "Depoze BTC ou nan adrès ki anba a:" "message": "Depoze BTC ou nan adrès ki anba a:"
}, },
"depositCoin": {
"message": "Depoze $1 ou nan adrès ki anba a",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "Depo Eth" "message": "Depo Eth"
}, },

View File

@ -463,10 +463,6 @@
"depositBTC": { "depositBTC": {
"message": "Deposita i tuoi BTC all'indirizzo sotto:" "message": "Deposita i tuoi BTC all'indirizzo sotto:"
}, },
"depositCoin": {
"message": "Deposita $1 all'indirizzo sotto",
"description": "Dice all'utente quale moneta ha selezionato per depositare con Shapeshift"
},
"depositEth": { "depositEth": {
"message": "Deposita Eth" "message": "Deposita Eth"
}, },

View File

@ -228,10 +228,6 @@
"depositBTC": { "depositBTC": {
"message": "BTCを下記のアドレスへ振込んでください:" "message": "BTCを下記のアドレスへ振込んでください:"
}, },
"depositCoin": {
"message": "$1を下記のアドレスへ振込んでください",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "ETHを入金" "message": "ETHを入金"
}, },

View File

@ -402,10 +402,6 @@
"depositBTC": { "depositBTC": {
"message": "다음 주소로 BTC를 입금해주세요." "message": "다음 주소로 BTC를 입금해주세요."
}, },
"depositCoin": {
"message": "다음 주소로 $1 만큼 입금해주세요.",
"description": "사용자에게 shapeshift에서 어떤 코인을 선택해 입금했는지 알려줍니다"
},
"depositEth": { "depositEth": {
"message": "이더 입금하기" "message": "이더 입금하기"
}, },

View File

@ -240,10 +240,6 @@
"depositBTC": { "depositBTC": {
"message": "Stort uw BTC op het onderstaande adres:" "message": "Stort uw BTC op het onderstaande adres:"
}, },
"depositCoin": {
"message": "Stort uw $1 op het onderstaande adres",
"description": "Laat de gebruiker weten welk muntje ze hebben geselecteerd om te deponeren met shapeshift"
},
"depositEth": { "depositEth": {
"message": "Aanbetaling Eth" "message": "Aanbetaling Eth"
}, },

View File

@ -201,10 +201,6 @@
"depositBTC": { "depositBTC": {
"message": "I-deposito ang iyong BTC sa address na ito:" "message": "I-deposito ang iyong BTC sa address na ito:"
}, },
"depositCoin": {
"message": "I-deposito ang iyong $1 sa address na ito",
"description": "Sinasabihan ang user kung ano ang coin na kanilang pinili para I-deposito gamit ang shapeshift"
},
"depositEth": { "depositEth": {
"message": "I-deposito ang Eth" "message": "I-deposito ang Eth"
}, },

View File

@ -249,10 +249,6 @@
"depositBTC": { "depositBTC": {
"message": "Zdeponuj swoje BTC na poniższy adres:" "message": "Zdeponuj swoje BTC na poniższy adres:"
}, },
"depositCoin": {
"message": "Zdeponuj $1 na poniższy adres",
"description": "Pokazuje użytkownikowi jakie waluty wybrał do zdeponowania w ShapeShift"
},
"depositEth": { "depositEth": {
"message": "Zdeponuj Eth" "message": "Zdeponuj Eth"
}, },

View File

@ -240,10 +240,6 @@
"depositBTC": { "depositBTC": {
"message": "Deposite as suas BTC no endereço abaixo:" "message": "Deposite as suas BTC no endereço abaixo:"
}, },
"depositCoin": {
"message": "Deposite $1 no endereço abaixo",
"description": "Diz ao usuário que moeda selecionou para depositar com shapeshift"
},
"depositEth": { "depositEth": {
"message": "Depositar Eth" "message": "Depositar Eth"
}, },

View File

@ -252,10 +252,6 @@
"depositBTC": { "depositBTC": {
"message": "Отправьте ваш BTC на адрес ниже:" "message": "Отправьте ваш BTC на адрес ниже:"
}, },
"depositCoin": {
"message": "Отправьте ваш $1 на адрес ниже",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "Пополнить Eth" "message": "Пополнить Eth"
}, },

View File

@ -243,10 +243,6 @@
"depositBTC": { "depositBTC": {
"message": "Vložte BTC na níže uvedenou adresu:" "message": "Vložte BTC na níže uvedenou adresu:"
}, },
"depositCoin": {
"message": "Vložte $1 na níže uvedenou adresu",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "Vložit Eth" "message": "Vložit Eth"
}, },

View File

@ -408,10 +408,6 @@
"depositBTC": { "depositBTC": {
"message": "Vplačajte vaš BTC na spodnji naslov:" "message": "Vplačajte vaš BTC na spodnji naslov:"
}, },
"depositCoin": {
"message": "Vplačajte vaš $1 na spodnji naslov",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "Vplačilo ETH" "message": "Vplačilo ETH"
}, },

View File

@ -240,10 +240,6 @@
"depositBTC": { "depositBTC": {
"message": "ฝากบิตคอยน์ของคุณไปที่แอดเดรสด้านล่างนี้:" "message": "ฝากบิตคอยน์ของคุณไปที่แอดเดรสด้านล่างนี้:"
}, },
"depositCoin": {
"message": "ฝาก $1 ของคุณไปที่แอดเดรสด้านล่างนี้:",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "การฝากอีเธอร์" "message": "การฝากอีเธอร์"
}, },

View File

@ -252,10 +252,6 @@
"depositBTC": { "depositBTC": {
"message": "கீழே உங்கள் முகவரிக்கு உங்கள் BTC வைப்போம்:" "message": "கீழே உங்கள் முகவரிக்கு உங்கள் BTC வைப்போம்:"
}, },
"depositCoin": {
"message": "உங்கள் முகவரிக்கு $ 1 ஐ கீழே உள்ளிடவும்",
"description": "சேபஷிபிட் உடன் வைப்புக்குத் தேர்ந்தெடுக்கப்பட்ட நாணயத்தை பயனரிடம் கூறுகிறார்"
},
"depositEth": { "depositEth": {
"message": "வைப்புத்தொகை எது " "message": "வைப்புத்தொகை எது "
}, },

View File

@ -252,10 +252,6 @@
"depositBTC": { "depositBTC": {
"message": "BTC'inizi aşağıdaki adrese yatırın:" "message": "BTC'inizi aşağıdaki adrese yatırın:"
}, },
"depositCoin": {
"message": "$1'nızı aşağıdaki adrese yatırın",
"description": "Kullanıcıya hangi jetonu seçtiyse onu yatırmasını shapeshift ile söyler."
},
"depositEth": { "depositEth": {
"message": "Eth yatır" "message": "Eth yatır"
}, },

View File

@ -201,10 +201,6 @@
"depositBTC": { "depositBTC": {
"message": "Ký gửi BTC đến địa chỉ sau:" "message": "Ký gửi BTC đến địa chỉ sau:"
}, },
"depositCoin": {
"description": "Báo cho người dùng biết đồng tiền nào họ đã chọn để ký gửi với ShapeShift",
"message": "Ký gửi $1 đến địa chỉ sau:"
},
"depositEth": { "depositEth": {
"message": "Ký gửi Eth" "message": "Ký gửi Eth"
}, },

View File

@ -261,10 +261,6 @@
"depositBTC": { "depositBTC": {
"message": "将你的 BTC 存入到下面的地址:" "message": "将你的 BTC 存入到下面的地址:"
}, },
"depositCoin": {
"message": "将你的 $1 存入到下面的地址",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "存入 Eth" "message": "存入 Eth"
}, },

View File

@ -378,10 +378,6 @@
"depositBTC": { "depositBTC": {
"message": "將您的 BTC 存入到下面的位址:" "message": "將您的 BTC 存入到下面的位址:"
}, },
"depositCoin": {
"message": "將您的 $1 存入到下面的位址",
"description": "Tells the user what coin they have selected to deposit with shapeshift"
},
"depositEth": { "depositEth": {
"message": "存入乙太幣" "message": "存入乙太幣"
}, },

View File

@ -5,7 +5,6 @@ const inherits = require('util').inherits
const connect = require('react-redux').connect const connect = require('react-redux').connect
const actions = require('../../../store/actions') const actions = require('../../../store/actions')
const { getNetworkDisplayName } = require('../../../../../app/scripts/controllers/network/util') const { getNetworkDisplayName } = require('../../../../../app/scripts/controllers/network/util')
const ShapeshiftForm = require('../shapeshift-form')
import Button from '../../ui/button' import Button from '../../ui/button'
@ -13,8 +12,6 @@ let DIRECT_DEPOSIT_ROW_TITLE
let DIRECT_DEPOSIT_ROW_TEXT let DIRECT_DEPOSIT_ROW_TEXT
let WYRE_ROW_TITLE let WYRE_ROW_TITLE
let WYRE_ROW_TEXT let WYRE_ROW_TEXT
let SHAPESHIFT_ROW_TITLE
let SHAPESHIFT_ROW_TEXT
let FAUCET_ROW_TITLE let FAUCET_ROW_TITLE
let COINSWITCH_ROW_TITLE let COINSWITCH_ROW_TITLE
let COINSWITCH_ROW_TEXT let COINSWITCH_ROW_TEXT
@ -56,15 +53,9 @@ function DepositEtherModal (_, context) {
DIRECT_DEPOSIT_ROW_TEXT = context.t('directDepositEtherExplainer') DIRECT_DEPOSIT_ROW_TEXT = context.t('directDepositEtherExplainer')
WYRE_ROW_TITLE = context.t('buyWithWyre') WYRE_ROW_TITLE = context.t('buyWithWyre')
WYRE_ROW_TEXT = context.t('buyWithWyreDescription') WYRE_ROW_TEXT = context.t('buyWithWyreDescription')
SHAPESHIFT_ROW_TITLE = context.t('depositShapeShift')
SHAPESHIFT_ROW_TEXT = context.t('depositShapeShiftExplainer')
FAUCET_ROW_TITLE = context.t('testFaucet') FAUCET_ROW_TITLE = context.t('testFaucet')
COINSWITCH_ROW_TITLE = context.t('buyCoinSwitch') COINSWITCH_ROW_TITLE = context.t('buyCoinSwitch')
COINSWITCH_ROW_TEXT = context.t('buyCoinSwitchExplainer') COINSWITCH_ROW_TEXT = context.t('buyCoinSwitchExplainer')
this.state = {
buyingWithShapeshift: false,
}
} }
DepositEtherModal.contextTypes = { DepositEtherModal.contextTypes = {
@ -131,7 +122,6 @@ DepositEtherModal.prototype.renderRow = function ({
DepositEtherModal.prototype.render = function () { DepositEtherModal.prototype.render = function () {
const { network, toWyre, toCoinSwitch, address, toFaucet } = this.props const { network, toWyre, toCoinSwitch, address, toFaucet } = this.props
const { buyingWithShapeshift } = this.state
const isTestNetwork = ['3', '4', '5', '42'].find(n => n === network) const isTestNetwork = ['3', '4', '5', '42'].find(n => n === network)
const networkName = getNetworkDisplayName(network) const networkName = getNetworkDisplayName(network)
@ -148,7 +138,6 @@ DepositEtherModal.prototype.render = function () {
h('div.page-container__header-close', { h('div.page-container__header-close', {
onClick: () => { onClick: () => {
this.setState({ buyingWithShapeshift: false })
this.props.hideWarning() this.props.hideWarning()
this.props.hideModal() this.props.hideModal()
}, },
@ -168,7 +157,6 @@ DepositEtherModal.prototype.render = function () {
text: DIRECT_DEPOSIT_ROW_TEXT, text: DIRECT_DEPOSIT_ROW_TEXT,
buttonLabel: this.context.t('viewAccount'), buttonLabel: this.context.t('viewAccount'),
onButtonClick: () => this.goToAccountDetailsModal(), onButtonClick: () => this.goToAccountDetailsModal(),
hide: buyingWithShapeshift,
}), }),
this.renderRow({ this.renderRow({
@ -177,7 +165,7 @@ DepositEtherModal.prototype.render = function () {
text: this.facuetRowText(networkName), text: this.facuetRowText(networkName),
buttonLabel: this.context.t('getEther'), buttonLabel: this.context.t('getEther'),
onButtonClick: () => toFaucet(network), onButtonClick: () => toFaucet(network),
hide: !isTestNetwork || buyingWithShapeshift, hide: !isTestNetwork,
}), }),
this.renderRow({ this.renderRow({
@ -191,7 +179,7 @@ DepositEtherModal.prototype.render = function () {
text: WYRE_ROW_TEXT, text: WYRE_ROW_TEXT,
buttonLabel: this.context.t('continueToWyre'), buttonLabel: this.context.t('continueToWyre'),
onButtonClick: () => toWyre(address), onButtonClick: () => toWyre(address),
hide: isTestNetwork || buyingWithShapeshift, hide: isTestNetwork,
}), }),
this.renderRow({ this.renderRow({
@ -205,29 +193,9 @@ DepositEtherModal.prototype.render = function () {
text: COINSWITCH_ROW_TEXT, text: COINSWITCH_ROW_TEXT,
buttonLabel: this.context.t('continueToCoinSwitch'), buttonLabel: this.context.t('continueToCoinSwitch'),
onButtonClick: () => toCoinSwitch(address), onButtonClick: () => toCoinSwitch(address),
hide: isTestNetwork || buyingWithShapeshift,
}),
this.renderRow({
logo: h('div.deposit-ether-modal__logo', {
style: {
backgroundImage: 'url(\'./images/shapeshift logo.png\')',
},
}),
title: SHAPESHIFT_ROW_TITLE,
text: SHAPESHIFT_ROW_TEXT,
buttonLabel: this.context.t('shapeshiftBuy'),
onButtonClick: () => this.setState({ buyingWithShapeshift: true }),
hide: isTestNetwork, hide: isTestNetwork,
hideButton: buyingWithShapeshift,
hideTitle: buyingWithShapeshift,
onBackClick: () => this.setState({ buyingWithShapeshift: false }),
showBackButton: this.state.buyingWithShapeshift,
className: buyingWithShapeshift && 'deposit-ether-modal__buy-row__shapeshift-buy',
}), }),
buyingWithShapeshift && h(ShapeshiftForm),
]), ]),
]), ]),

View File

@ -16,7 +16,6 @@ const AccountDetailsModal = require('./account-details-modal')
const EditAccountNameModal = require('./edit-account-name-modal') const EditAccountNameModal = require('./edit-account-name-modal')
const ExportPrivateKeyModal = require('./export-private-key-modal') const ExportPrivateKeyModal = require('./export-private-key-modal')
const NewAccountModal = require('./new-account-modal') const NewAccountModal = require('./new-account-modal')
const ShapeshiftDepositTxModal = require('./shapeshift-deposit-tx-modal.js')
const HideTokenConfirmationModal = require('./hide-token-confirmation-modal') const HideTokenConfirmationModal = require('./hide-token-confirmation-modal')
const NotifcationModal = require('./notification-modal') const NotifcationModal = require('./notification-modal')
const QRScanner = require('./qr-scanner') const QRScanner = require('./qr-scanner')
@ -181,13 +180,6 @@ const MODALS = {
...accountModalStyle, ...accountModalStyle,
}, },
SHAPESHIFT_DEPOSIT_TX: {
contents: [
h(ShapeshiftDepositTxModal),
],
...accountModalStyle,
},
HIDE_TOKEN_CONFIRMATION: { HIDE_TOKEN_CONFIRMATION: {
contents: [ contents: [
h(HideTokenConfirmationModal, {}, []), h(HideTokenConfirmationModal, {}, []),

View File

@ -1,40 +0,0 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../../store/actions')
const QrView = require('../../ui/qr-code')
const AccountModalContainer = require('./account-modal-container')
function mapStateToProps (state) {
return {
Qr: state.appState.modal.modalState.props.Qr,
}
}
function mapDispatchToProps (dispatch) {
return {
hideModal: () => {
dispatch(actions.hideModal())
},
}
}
inherits(ShapeshiftDepositTxModal, Component)
function ShapeshiftDepositTxModal () {
Component.call(this)
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(ShapeshiftDepositTxModal)
ShapeshiftDepositTxModal.prototype.render = function () {
const { Qr } = this.props
return h(AccountModalContainer, {
}, [
h('div', {}, [
h(QrView, {key: 'qr', Qr}),
]),
])
}

View File

@ -1,256 +0,0 @@
const h = require('react-hyperscript')
const inherits = require('util').inherits
const PropTypes = require('prop-types')
const Component = require('react').Component
const connect = require('react-redux').connect
const classnames = require('classnames')
const qrcode = require('qrcode-generator')
const { shapeShiftSubview, pairUpdate, buyWithShapeShift } = require('../../store/actions')
const { isValidAddress } = require('../../helpers/utils/util')
const SimpleDropdown = require('./dropdowns/simple-dropdown')
import Button from '../ui/button'
function mapStateToProps (state) {
const {
coinOptions,
tokenExchangeRates,
selectedAddress,
} = state.metamask
const { warning } = state.appState
return {
coinOptions,
tokenExchangeRates,
selectedAddress,
warning,
}
}
function mapDispatchToProps (dispatch) {
return {
shapeShiftSubview: () => dispatch(shapeShiftSubview()),
pairUpdate: coin => dispatch(pairUpdate(coin)),
buyWithShapeShift: data => dispatch(buyWithShapeShift(data)),
}
}
ShapeshiftForm.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(ShapeshiftForm)
inherits(ShapeshiftForm, Component)
function ShapeshiftForm () {
Component.call(this)
this.state = {
depositCoin: 'btc',
refundAddress: '',
showQrCode: false,
depositAddress: '',
errorMessage: '',
isLoading: false,
bought: false,
}
}
ShapeshiftForm.prototype.getCoinPair = function () {
return `${this.state.depositCoin.toUpperCase()}_ETH`
}
ShapeshiftForm.prototype.componentWillMount = function () {
this.props.shapeShiftSubview()
}
ShapeshiftForm.prototype.onCoinChange = function (coin) {
this.setState({
depositCoin: coin,
errorMessage: '',
})
this.props.pairUpdate(coin)
}
ShapeshiftForm.prototype.onBuyWithShapeShift = function () {
this.setState({
isLoading: true,
showQrCode: true,
})
const {
buyWithShapeShift,
selectedAddress: withdrawal,
} = this.props
const {
refundAddress: returnAddress,
depositCoin,
} = this.state
const pair = `${depositCoin}_eth`
const data = {
withdrawal,
pair,
returnAddress,
// Public api key
'apiKey': '803d1f5df2ed1b1476e4b9e6bcd089e34d8874595dda6a23b67d93c56ea9cc2445e98a6748b219b2b6ad654d9f075f1f1db139abfa93158c04e825db122c14b6',
}
if (isValidAddress(withdrawal)) {
buyWithShapeShift(data)
.then(d => this.setState({
showQrCode: true,
depositAddress: d.deposit,
isLoading: false,
}))
.catch(() => this.setState({
showQrCode: false,
errorMessage: this.context.t('invalidRequest'),
isLoading: false,
}))
}
}
ShapeshiftForm.prototype.renderMetadata = function (label, value) {
return h('div', {className: 'shapeshift-form__metadata-wrapper'}, [
h('div.shapeshift-form__metadata-label', {}, [
h('span', `${label}:`),
]),
h('div.shapeshift-form__metadata-value', {}, [
h('span', value),
]),
])
}
ShapeshiftForm.prototype.renderMarketInfo = function () {
const { tokenExchangeRates } = this.props
const {
limit,
rate,
minimum,
} = tokenExchangeRates[this.getCoinPair()] || {}
return h('div.shapeshift-form__metadata', {}, [
this.renderMetadata(this.context.t('status'), limit ? this.context.t('available') : this.context.t('unavailable')),
this.renderMetadata(this.context.t('limit'), limit),
this.renderMetadata(this.context.t('exchangeRate'), rate),
this.renderMetadata(this.context.t('min'), minimum),
])
}
ShapeshiftForm.prototype.renderQrCode = function () {
const { depositAddress, isLoading, depositCoin } = this.state
const qrImage = qrcode(4, 'M')
qrImage.addData(depositAddress)
qrImage.make()
return h('div.shapeshift-form', {}, [
h('div.shapeshift-form__deposit-instruction', [
this.context.t('depositCoin', [depositCoin.toUpperCase()]),
]),
h('div', depositAddress),
h('div.shapeshift-form__qr-code', [
isLoading
? h('img', {
src: 'images/loading.svg',
style: { width: '60px'},
})
: h('div', {
dangerouslySetInnerHTML: { __html: qrImage.createTableTag(4) },
}),
]),
this.renderMarketInfo(),
])
}
ShapeshiftForm.prototype.render = function () {
const { coinOptions, btnClass, warning } = this.props
const { errorMessage, showQrCode, depositAddress } = this.state
const { tokenExchangeRates } = this.props
const token = tokenExchangeRates[this.getCoinPair()]
return h('div.shapeshift-form-wrapper', [
showQrCode
? this.renderQrCode()
: h('div.modal-shapeshift-form', [
h('div.shapeshift-form__selectors', [
h('div.shapeshift-form__selector', [
h('div.shapeshift-form__selector-label', this.context.t('deposit')),
h(SimpleDropdown, {
selectedOption: this.state.depositCoin,
onSelect: (coin) => this.onCoinChange(coin),
options: Object.entries(coinOptions).map(([coin]) => ({
value: coin.toLowerCase(),
displayValue: coin,
})),
}),
]),
h('div.icon.shapeshift-form__caret', {
style: { backgroundImage: 'url(images/caret-right.svg)'},
}),
h('div.shapeshift-form__selector', [
h('div.shapeshift-form__selector-label', [
this.context.t('receive'),
]),
h('div.shapeshift-form__selector-input', ['ETH']),
]),
]),
warning && h('div.shapeshift-form__address-input-label', warning),
!warning && h('div', {
className: classnames('shapeshift-form__address-input-wrapper', {
'shapeshift-form__address-input-wrapper--error': errorMessage,
}),
}, [
h('div.shapeshift-form__address-input-label', [
this.context.t('refundAddress'),
]),
h('input.shapeshift-form__address-input', {
type: 'text',
onChange: e => this.setState({
refundAddress: e.target.value,
errorMessage: '',
}),
}),
h('divshapeshift-form__address-input-error-message', [errorMessage]),
]),
!warning && this.renderMarketInfo(),
]),
!depositAddress && h(Button, {
type: 'secondary',
large: true,
className: `${btnClass} shapeshift-form__shapeshift-buy-btn`,
disabled: !token,
onClick: () => this.onBuyWithShapeShift(),
}, [this.context.t('buy')]),
])
}

View File

@ -2384,10 +2384,6 @@ function reshowQrCode (data, coin) {
dispatch(actions.hideLoadingIndication()) dispatch(actions.hideLoadingIndication())
return dispatch(actions.showQrView(data, message)) return dispatch(actions.showQrView(data, message))
// return dispatch(actions.showModal({
// name: 'SHAPESHIFT_DEPOSIT_TX',
// Qr: { data, message },
// }))
}) })
} }
} }