aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Stacey <markjstacey@gmail.com>2019-06-25 00:47:48 +0800
committerDan J Miller <danjm.com@gmail.com>2019-06-25 00:47:48 +0800
commit313def1ce2459e30e12572e28605da13c5fe3fbe (patch)
treeb302bf9b7ad026d3bf9020c838521443c1a3ea81
parenta257a73172cb8d51db20461b982b9b4accb2a429 (diff)
downloadtangerine-wallet-browser-313def1ce2459e30e12572e28605da13c5fe3fbe.tar.gz
tangerine-wallet-browser-313def1ce2459e30e12572e28605da13c5fe3fbe.tar.zst
tangerine-wallet-browser-313def1ce2459e30e12572e28605da13c5fe3fbe.zip
Remove shapeshift deposit form (#6746)
Closes #6478
-rw-r--r--app/_locales/cs/messages.json4
-rw-r--r--app/_locales/de/messages.json4
-rw-r--r--app/_locales/en/messages.json4
-rw-r--r--app/_locales/es/messages.json4
-rw-r--r--app/_locales/fr/messages.json4
-rw-r--r--app/_locales/hn/messages.json4
-rw-r--r--app/_locales/ht/messages.json4
-rw-r--r--app/_locales/it/messages.json4
-rw-r--r--app/_locales/ja/messages.json4
-rw-r--r--app/_locales/ko/messages.json4
-rw-r--r--app/_locales/nl/messages.json4
-rw-r--r--app/_locales/ph/messages.json4
-rw-r--r--app/_locales/pl/messages.json4
-rw-r--r--app/_locales/pt/messages.json4
-rw-r--r--app/_locales/ru/messages.json4
-rw-r--r--app/_locales/sk/messages.json4
-rw-r--r--app/_locales/sl/messages.json4
-rw-r--r--app/_locales/th/messages.json4
-rw-r--r--app/_locales/tml/messages.json4
-rw-r--r--app/_locales/tr/messages.json4
-rw-r--r--app/_locales/vi/messages.json4
-rw-r--r--app/_locales/zh_CN/messages.json4
-rw-r--r--app/_locales/zh_TW/messages.json4
-rw-r--r--ui/app/components/app/modals/deposit-ether-modal.js36
-rw-r--r--ui/app/components/app/modals/modal.js8
-rw-r--r--ui/app/components/app/modals/shapeshift-deposit-tx-modal.js40
-rw-r--r--ui/app/components/app/shapeshift-form.js256
-rw-r--r--ui/app/store/actions.js4
28 files changed, 2 insertions, 434 deletions
diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json
index a28c4cb4a..187ffd95f 100644
--- a/app/_locales/cs/messages.json
+++ b/app/_locales/cs/messages.json
@@ -252,10 +252,6 @@
"depositBTC": {
"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": {
"message": "Vložit Eth"
},
diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json
index b76f87772..98a8bf972 100644
--- a/app/_locales/de/messages.json
+++ b/app/_locales/de/messages.json
@@ -249,10 +249,6 @@
"depositBTC": {
"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": {
"message": "Eth kaufen"
},
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index 774ae4c85..cc087867a 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -466,10 +466,6 @@
"depositBTC": {
"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": {
"message": "Deposit Eth"
},
diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json
index 3bdbfa852..06531b1dc 100644
--- a/app/_locales/es/messages.json
+++ b/app/_locales/es/messages.json
@@ -264,10 +264,6 @@
"depositBTC": {
"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": {
"message": "Depositar Ether"
},
diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json
index d2ba10009..70effb3ea 100644
--- a/app/_locales/fr/messages.json
+++ b/app/_locales/fr/messages.json
@@ -330,10 +330,6 @@
"depositBTC": {
"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": {
"message": "Déposer Eth"
},
diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json
index 6c27ee1bc..54ddcc02b 100644
--- a/app/_locales/hn/messages.json
+++ b/app/_locales/hn/messages.json
@@ -240,10 +240,6 @@
"depositBTC": {
"message": "नीचे दिए गए पते पर अपना बीटीसी जमा करें:"
},
- "depositCoin": {
- "message": "नीचे दिए गए पते पर अपना $1 जमा करें",
- "description": "उपयोगकर्ता को बताता है कि उन्होंने सिक्का के साथ जमा करने के लिए किस सिक्का का चयन किया है"
- },
"depositEth": {
"message": "Eth जमाआर्थ"
},
diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json
index 4a4c92f3a..720c35889 100644
--- a/app/_locales/ht/messages.json
+++ b/app/_locales/ht/messages.json
@@ -336,10 +336,6 @@
"depositBTC": {
"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": {
"message": "Depo Eth"
},
diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json
index 09ba045b9..c79f22b71 100644
--- a/app/_locales/it/messages.json
+++ b/app/_locales/it/messages.json
@@ -463,10 +463,6 @@
"depositBTC": {
"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": {
"message": "Deposita Eth"
},
diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json
index fcac67894..49b033997 100644
--- a/app/_locales/ja/messages.json
+++ b/app/_locales/ja/messages.json
@@ -228,10 +228,6 @@
"depositBTC": {
"message": "BTCを下記のアドレスへ振込んでください:"
},
- "depositCoin": {
- "message": "$1を下記のアドレスへ振込んでください",
- "description": "Tells the user what coin they have selected to deposit with shapeshift"
- },
"depositEth": {
"message": "ETHを入金"
},
diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json
index bf11640e2..541d9dd5c 100644
--- a/app/_locales/ko/messages.json
+++ b/app/_locales/ko/messages.json
@@ -402,10 +402,6 @@
"depositBTC": {
"message": "다음 주소로 BTC를 입금해주세요."
},
- "depositCoin": {
- "message": "다음 주소로 $1 만큼 입금해주세요.",
- "description": "사용자에게 shapeshift에서 어떤 코인을 선택해 입금했는지 알려줍니다"
- },
"depositEth": {
"message": "이더 입금하기"
},
diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json
index 12bde6585..ade7327de 100644
--- a/app/_locales/nl/messages.json
+++ b/app/_locales/nl/messages.json
@@ -240,10 +240,6 @@
"depositBTC": {
"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": {
"message": "Aanbetaling Eth"
},
diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json
index da3cf266d..c8cde27f6 100644
--- a/app/_locales/ph/messages.json
+++ b/app/_locales/ph/messages.json
@@ -201,10 +201,6 @@
"depositBTC": {
"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": {
"message": "I-deposito ang Eth"
},
diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json
index 026f4b3ec..868ab0cae 100644
--- a/app/_locales/pl/messages.json
+++ b/app/_locales/pl/messages.json
@@ -249,10 +249,6 @@
"depositBTC": {
"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": {
"message": "Zdeponuj Eth"
},
diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json
index e51b1f72e..5724bce88 100644
--- a/app/_locales/pt/messages.json
+++ b/app/_locales/pt/messages.json
@@ -240,10 +240,6 @@
"depositBTC": {
"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": {
"message": "Depositar Eth"
},
diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json
index f80efcc56..e56441186 100644
--- a/app/_locales/ru/messages.json
+++ b/app/_locales/ru/messages.json
@@ -252,10 +252,6 @@
"depositBTC": {
"message": "Отправьте ваш BTC на адрес ниже:"
},
- "depositCoin": {
- "message": "Отправьте ваш $1 на адрес ниже",
- "description": "Tells the user what coin they have selected to deposit with shapeshift"
- },
"depositEth": {
"message": "Пополнить Eth"
},
diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json
index febcc9141..f98de674b 100644
--- a/app/_locales/sk/messages.json
+++ b/app/_locales/sk/messages.json
@@ -243,10 +243,6 @@
"depositBTC": {
"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": {
"message": "Vložit Eth"
},
diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json
index 2f3616dee..d04ba1ee7 100644
--- a/app/_locales/sl/messages.json
+++ b/app/_locales/sl/messages.json
@@ -408,10 +408,6 @@
"depositBTC": {
"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": {
"message": "Vplačilo ETH"
},
diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json
index d851d325f..a49cf31ad 100644
--- a/app/_locales/th/messages.json
+++ b/app/_locales/th/messages.json
@@ -240,10 +240,6 @@
"depositBTC": {
"message": "ฝากบิตคอยน์ของคุณไปที่แอดเดรสด้านล่างนี้:"
},
- "depositCoin": {
- "message": "ฝาก $1 ของคุณไปที่แอดเดรสด้านล่างนี้:",
- "description": "Tells the user what coin they have selected to deposit with shapeshift"
- },
"depositEth": {
"message": "การฝากอีเธอร์"
},
diff --git a/app/_locales/tml/messages.json b/app/_locales/tml/messages.json
index e1ef45138..2f883b26b 100644
--- a/app/_locales/tml/messages.json
+++ b/app/_locales/tml/messages.json
@@ -252,10 +252,6 @@
"depositBTC": {
"message": "கீழே உங்கள் முகவரிக்கு உங்கள் BTC வைப்போம்:"
},
- "depositCoin": {
- "message": "உங்கள் முகவரிக்கு $ 1 ஐ கீழே உள்ளிடவும்",
- "description": "சேபஷிபிட் உடன் வைப்புக்குத் தேர்ந்தெடுக்கப்பட்ட நாணயத்தை பயனரிடம் கூறுகிறார்"
- },
"depositEth": {
"message": "வைப்புத்தொகை எது "
},
diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json
index bcf96dece..726024764 100644
--- a/app/_locales/tr/messages.json
+++ b/app/_locales/tr/messages.json
@@ -252,10 +252,6 @@
"depositBTC": {
"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": {
"message": "Eth yatır"
},
diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json
index 857f78597..aee6474b6 100644
--- a/app/_locales/vi/messages.json
+++ b/app/_locales/vi/messages.json
@@ -201,10 +201,6 @@
"depositBTC": {
"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": {
"message": "Ký gửi Eth"
},
diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json
index 0d3727703..d14b99acb 100644
--- a/app/_locales/zh_CN/messages.json
+++ b/app/_locales/zh_CN/messages.json
@@ -261,10 +261,6 @@
"depositBTC": {
"message": "将你的 BTC 存入到下面的地址:"
},
- "depositCoin": {
- "message": "将你的 $1 存入到下面的地址",
- "description": "Tells the user what coin they have selected to deposit with shapeshift"
- },
"depositEth": {
"message": "存入 Eth"
},
diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json
index 4df95f72f..18e30188e 100644
--- a/app/_locales/zh_TW/messages.json
+++ b/app/_locales/zh_TW/messages.json
@@ -378,10 +378,6 @@
"depositBTC": {
"message": "將您的 BTC 存入到下面的位址:"
},
- "depositCoin": {
- "message": "將您的 $1 存入到下面的位址",
- "description": "Tells the user what coin they have selected to deposit with shapeshift"
- },
"depositEth": {
"message": "存入乙太幣"
},
diff --git a/ui/app/components/app/modals/deposit-ether-modal.js b/ui/app/components/app/modals/deposit-ether-modal.js
index f56069d65..20c4d018c 100644
--- a/ui/app/components/app/modals/deposit-ether-modal.js
+++ b/ui/app/components/app/modals/deposit-ether-modal.js
@@ -5,7 +5,6 @@ const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../../store/actions')
const { getNetworkDisplayName } = require('../../../../../app/scripts/controllers/network/util')
-const ShapeshiftForm = require('../shapeshift-form')
import Button from '../../ui/button'
@@ -13,8 +12,6 @@ let DIRECT_DEPOSIT_ROW_TITLE
let DIRECT_DEPOSIT_ROW_TEXT
let WYRE_ROW_TITLE
let WYRE_ROW_TEXT
-let SHAPESHIFT_ROW_TITLE
-let SHAPESHIFT_ROW_TEXT
let FAUCET_ROW_TITLE
let COINSWITCH_ROW_TITLE
let COINSWITCH_ROW_TEXT
@@ -56,15 +53,9 @@ function DepositEtherModal (_, context) {
DIRECT_DEPOSIT_ROW_TEXT = context.t('directDepositEtherExplainer')
WYRE_ROW_TITLE = context.t('buyWithWyre')
WYRE_ROW_TEXT = context.t('buyWithWyreDescription')
- SHAPESHIFT_ROW_TITLE = context.t('depositShapeShift')
- SHAPESHIFT_ROW_TEXT = context.t('depositShapeShiftExplainer')
FAUCET_ROW_TITLE = context.t('testFaucet')
COINSWITCH_ROW_TITLE = context.t('buyCoinSwitch')
COINSWITCH_ROW_TEXT = context.t('buyCoinSwitchExplainer')
-
- this.state = {
- buyingWithShapeshift: false,
- }
}
DepositEtherModal.contextTypes = {
@@ -131,7 +122,6 @@ DepositEtherModal.prototype.renderRow = function ({
DepositEtherModal.prototype.render = function () {
const { network, toWyre, toCoinSwitch, address, toFaucet } = this.props
- const { buyingWithShapeshift } = this.state
const isTestNetwork = ['3', '4', '5', '42'].find(n => n === network)
const networkName = getNetworkDisplayName(network)
@@ -148,7 +138,6 @@ DepositEtherModal.prototype.render = function () {
h('div.page-container__header-close', {
onClick: () => {
- this.setState({ buyingWithShapeshift: false })
this.props.hideWarning()
this.props.hideModal()
},
@@ -168,7 +157,6 @@ DepositEtherModal.prototype.render = function () {
text: DIRECT_DEPOSIT_ROW_TEXT,
buttonLabel: this.context.t('viewAccount'),
onButtonClick: () => this.goToAccountDetailsModal(),
- hide: buyingWithShapeshift,
}),
this.renderRow({
@@ -177,7 +165,7 @@ DepositEtherModal.prototype.render = function () {
text: this.facuetRowText(networkName),
buttonLabel: this.context.t('getEther'),
onButtonClick: () => toFaucet(network),
- hide: !isTestNetwork || buyingWithShapeshift,
+ hide: !isTestNetwork,
}),
this.renderRow({
@@ -191,7 +179,7 @@ DepositEtherModal.prototype.render = function () {
text: WYRE_ROW_TEXT,
buttonLabel: this.context.t('continueToWyre'),
onButtonClick: () => toWyre(address),
- hide: isTestNetwork || buyingWithShapeshift,
+ hide: isTestNetwork,
}),
this.renderRow({
@@ -205,29 +193,9 @@ DepositEtherModal.prototype.render = function () {
text: COINSWITCH_ROW_TEXT,
buttonLabel: this.context.t('continueToCoinSwitch'),
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,
- 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),
-
]),
]),
diff --git a/ui/app/components/app/modals/modal.js b/ui/app/components/app/modals/modal.js
index 717f623af..90432da96 100644
--- a/ui/app/components/app/modals/modal.js
+++ b/ui/app/components/app/modals/modal.js
@@ -16,7 +16,6 @@ const AccountDetailsModal = require('./account-details-modal')
const EditAccountNameModal = require('./edit-account-name-modal')
const ExportPrivateKeyModal = require('./export-private-key-modal')
const NewAccountModal = require('./new-account-modal')
-const ShapeshiftDepositTxModal = require('./shapeshift-deposit-tx-modal.js')
const HideTokenConfirmationModal = require('./hide-token-confirmation-modal')
const NotifcationModal = require('./notification-modal')
const QRScanner = require('./qr-scanner')
@@ -181,13 +180,6 @@ const MODALS = {
...accountModalStyle,
},
- SHAPESHIFT_DEPOSIT_TX: {
- contents: [
- h(ShapeshiftDepositTxModal),
- ],
- ...accountModalStyle,
- },
-
HIDE_TOKEN_CONFIRMATION: {
contents: [
h(HideTokenConfirmationModal, {}, []),
diff --git a/ui/app/components/app/modals/shapeshift-deposit-tx-modal.js b/ui/app/components/app/modals/shapeshift-deposit-tx-modal.js
deleted file mode 100644
index ada9430f7..000000000
--- a/ui/app/components/app/modals/shapeshift-deposit-tx-modal.js
+++ /dev/null
@@ -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}),
- ]),
- ])
-}
diff --git a/ui/app/components/app/shapeshift-form.js b/ui/app/components/app/shapeshift-form.js
deleted file mode 100644
index 34a6f3acd..000000000
--- a/ui/app/components/app/shapeshift-form.js
+++ /dev/null
@@ -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')]),
-
- ])
-}
diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js
index aff2636ba..dc4c277ad 100644
--- a/ui/app/store/actions.js
+++ b/ui/app/store/actions.js
@@ -2384,10 +2384,6 @@ function reshowQrCode (data, coin) {
dispatch(actions.hideLoadingIndication())
return dispatch(actions.showQrView(data, message))
- // return dispatch(actions.showModal({
- // name: 'SHAPESHIFT_DEPOSIT_TX',
- // Qr: { data, message },
- // }))
})
}
}