diff options
Merge branch 'develop' of https://github.com/vimalsagar/metamask-extension into vimalsagar-develop
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/app/modals/deposit-ether-modal.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/ui/app/components/app/modals/deposit-ether-modal.js b/ui/app/components/app/modals/deposit-ether-modal.js index 082ff76a9..def88f085 100644 --- a/ui/app/components/app/modals/deposit-ether-modal.js +++ b/ui/app/components/app/modals/deposit-ether-modal.js @@ -16,6 +16,8 @@ let WYRE_ROW_TEXT let SHAPESHIFT_ROW_TITLE let SHAPESHIFT_ROW_TEXT let FAUCET_ROW_TITLE +let COINSWITCH_ROW_TITLE +let COINSWITCH_ROW_TEXT function mapStateToProps (state) { return { @@ -27,7 +29,10 @@ function mapStateToProps (state) { function mapDispatchToProps (dispatch) { return { toCoinbase: (address) => { - dispatch(actions.buyEth({ network: '1', address, amount: 0 })) + dispatch(actions.buyEth({ service: 'coinbase', address, amount: 0 })) + }, + toCoinSwitch: (address) => { + dispatch(actions.buyEth({ service: 'coinswitch', address })) }, hideModal: () => { dispatch(actions.hideModal()) @@ -54,6 +59,8 @@ function DepositEtherModal (props, context) { 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, @@ -123,7 +130,7 @@ DepositEtherModal.prototype.renderRow = function ({ } DepositEtherModal.prototype.render = function () { - const { network, toCoinbase, address, toFaucet } = this.props + const { network, toCoinbase, toCoinSwitch, address, toFaucet } = this.props const { buyingWithShapeshift } = this.state const isTestNetwork = ['3', '4', '42'].find(n => n === network) @@ -190,6 +197,20 @@ DepositEtherModal.prototype.render = function () { this.renderRow({ logo: h('div.deposit-ether-modal__logo', { style: { + backgroundImage: 'url(\'./images/coinswitch_logo.png\')', + height: '40px', + }, + }), + title: COINSWITCH_ROW_TITLE, + 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\')', }, }), |