aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-04-05 09:23:46 +0800
committerkumavis <aaron@kumavis.me>2017-04-05 09:23:46 +0800
commit5a91adf7d802097805938e3d54fe7256b19724d1 (patch)
tree9ad83ef345650796822b5462cff0d0bf5eab9b22 /ui/app
parent5d967eeebb9f3cf4c2d3fcfe0b74cf6e8440c3cb (diff)
downloadtangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.gz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.bz2
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.lz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.xz
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.tar.zst
tangerine-wallet-browser-5a91adf7d802097805938e3d54fe7256b19724d1.zip
add platforms to mascara + move buyEther window open to ui
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/actions.js8
-rw-r--r--ui/app/components/buy-button-subview.js13
-rw-r--r--ui/app/components/coinbase-form.js2
3 files changed, 13 insertions, 10 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 60b4c6f03..8934299e7 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -1,3 +1,5 @@
+const getBuyEthUrl = require('../../app/scripts/lib/buy-eth-url')
+
var actions = {
_setBackgroundConnection: _setBackgroundConnection,
@@ -833,10 +835,10 @@ function showSendPage () {
}
}
-function buyEth (address, amount) {
+function buyEth (opts) {
return (dispatch) => {
- log.debug(`background.buyEth`)
- background.buyEth(address, amount)
+ const url = getBuyEthUrl(opts)
+ global.platform.openWindow({ url })
dispatch({
type: actions.BUY_ETH,
})
diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js
index 2b1675b6d..6810303e1 100644
--- a/ui/app/components/buy-button-subview.js
+++ b/ui/app/components/buy-button-subview.js
@@ -104,7 +104,8 @@ BuyButtonSubview.prototype.render = function () {
}
BuyButtonSubview.prototype.formVersionSubview = function () {
- if (this.props.network === '1') {
+ const network = this.props.network
+ if (network === '1') {
if (this.props.buyView.formView.coinbase) {
return h(CoinbaseForm, this.props)
} else if (this.props.buyView.formView.shapeshift) {
@@ -123,15 +124,15 @@ BuyButtonSubview.prototype.formVersionSubview = function () {
marginBottom: '15px',
},
}, 'In order to access this feature, please switch to the Main Network'),
- ((this.props.network === '3') || (this.props.network === '42')) ? h('h3.text-transform-uppercase', 'or go to the') : null,
- (this.props.network === '3') ? h('button.text-transform-uppercase', {
- onClick: () => this.props.dispatch(actions.buyEth()),
+ ((network === '3') || (network === '42')) ? h('h3.text-transform-uppercase', 'or go to the') : null,
+ (network === '3') ? h('button.text-transform-uppercase', {
+ onClick: () => this.props.dispatch(actions.buyEth({ network })),
style: {
marginTop: '15px',
},
}, 'Ropsten Test Faucet') : null,
- (this.props.network === '42') ? h('button.text-transform-uppercase', {
- onClick: () => this.props.dispatch(actions.buyEth()),
+ (network === '42') ? h('button.text-transform-uppercase', {
+ onClick: () => this.props.dispatch(actions.buyEth({ network })),
style: {
marginTop: '15px',
},
diff --git a/ui/app/components/coinbase-form.js b/ui/app/components/coinbase-form.js
index 40f5719bb..fd5816a21 100644
--- a/ui/app/components/coinbase-form.js
+++ b/ui/app/components/coinbase-form.js
@@ -112,7 +112,7 @@ CoinbaseForm.prototype.toCoinbase = function () {
var message
if (isValidAddress(address) && isValidAmountforCoinBase(amount).valid) {
- props.dispatch(actions.buyEth(address, props.buyView.amount))
+ props.dispatch(actions.buyEth({ network: '1', address, amount: props.buyView.amount }))
} else if (!isValidAmountforCoinBase(amount).valid) {
message = isValidAmountforCoinBase(amount).message
return props.dispatch(actions.displayWarning(message))