aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-11-16 05:33:47 +0800
committerGitHub <noreply@github.com>2017-11-16 05:33:47 +0800
commitb944a63ff89e3c45f7d7e49b2d93a5442cde4462 (patch)
treebcd8ce2e0de5aef5edff1267d892cb66410a77c7 /ui/app/components/modals
parentaa538c52a747b4ab0ed6cdf3d7b7acf5a2972f86 (diff)
parentfbd04a6af6e9eda22eebaae27d712ae08272c131 (diff)
downloadtangerine-wallet-browser-b944a63ff89e3c45f7d7e49b2d93a5442cde4462.tar
tangerine-wallet-browser-b944a63ff89e3c45f7d7e49b2d93a5442cde4462.tar.gz
tangerine-wallet-browser-b944a63ff89e3c45f7d7e49b2d93a5442cde4462.tar.bz2
tangerine-wallet-browser-b944a63ff89e3c45f7d7e49b2d93a5442cde4462.tar.lz
tangerine-wallet-browser-b944a63ff89e3c45f7d7e49b2d93a5442cde4462.tar.xz
tangerine-wallet-browser-b944a63ff89e3c45f7d7e49b2d93a5442cde4462.tar.zst
tangerine-wallet-browser-b944a63ff89e3c45f7d7e49b2d93a5442cde4462.zip
Merge pull request #2591 from MetaMask/NewUI-flat
Release 4.0.4
Diffstat (limited to 'ui/app/components/modals')
-rw-r--r--ui/app/components/modals/buy-options-modal.js38
-rw-r--r--ui/app/components/modals/modal.js2
2 files changed, 24 insertions, 16 deletions
diff --git a/ui/app/components/modals/buy-options-modal.js b/ui/app/components/modals/buy-options-modal.js
index 33615c483..d735983f9 100644
--- a/ui/app/components/modals/buy-options-modal.js
+++ b/ui/app/components/modals/buy-options-modal.js
@@ -3,6 +3,7 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../actions')
+const networkNames = require('../../../../app/scripts/config.js').networkNames
function mapStateToProps (state) {
return {
@@ -22,6 +23,7 @@ function mapDispatchToProps (dispatch) {
showAccountDetailModal: () => {
dispatch(actions.showModal({ name: 'ACCOUNT_DETAILS' }))
},
+ toFaucet: network => dispatch(actions.buyEth({ network })),
}
}
@@ -32,7 +34,20 @@ function BuyOptions () {
module.exports = connect(mapStateToProps, mapDispatchToProps)(BuyOptions)
+BuyOptions.prototype.renderModalContentOption = function (title, header, onClick) {
+ return h('div.buy-modal-content-option', {
+ onClick,
+ }, [
+ h('div.buy-modal-content-option-title', {}, title),
+ h('div.buy-modal-content-option-subtitle', {}, header),
+ ])
+}
+
BuyOptions.prototype.render = function () {
+ const { network, toCoinbase, address, toFaucet } = this.props
+ const isTestNetwork = ['3', '4', '42'].find(n => n === network)
+ const networkName = networkNames[network]
+
return h('div', {}, [
h('div.buy-modal-content.transfers-subview', {
}, [
@@ -47,27 +62,20 @@ BuyOptions.prototype.render = function () {
h('div.buy-modal-content-options.flex-column.flex-center', {}, [
- h('div.buy-modal-content-option', {
- onClick: () => {
- const { toCoinbase, address } = this.props
- toCoinbase(address)
- },
- }, [
- h('div.buy-modal-content-option-title', {}, 'Coinbase'),
- h('div.buy-modal-content-option-subtitle', {}, 'Deposit with Fiat'),
- ]),
+ isTestNetwork
+ ? this.renderModalContentOption(networkName, 'Test Faucet', () => toFaucet(network))
+ : this.renderModalContentOption('Coinbase', 'Deposit with Fiat', () => toCoinbase(address)),
// h('div.buy-modal-content-option', {}, [
// h('div.buy-modal-content-option-title', {}, 'Shapeshift'),
// h('div.buy-modal-content-option-subtitle', {}, 'Trade any digital asset for any other'),
// ]),
- h('div.buy-modal-content-option', {
- onClick: () => this.goToAccountDetailsModal(),
- }, [
- h('div.buy-modal-content-option-title', {}, 'Direct Deposit'),
- h('div.buy-modal-content-option-subtitle', {}, 'Deposit from another account'),
- ]),
+ this.renderModalContentOption(
+ 'Direct Deposit',
+ 'Deposit from another account',
+ () => this.goToAccountDetailsModal()
+ ),
]),
diff --git a/ui/app/components/modals/modal.js b/ui/app/components/modals/modal.js
index 842081f40..f2909f3c3 100644
--- a/ui/app/components/modals/modal.js
+++ b/ui/app/components/modals/modal.js
@@ -189,7 +189,7 @@ const MODALS = {
}
const BACKDROPSTYLE = {
- backgroundColor: 'rgba(245, 245, 245, 0.85)',
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
}
function mapStateToProps (state) {