From 82b11b69a5dea38a4a036096528354a5a291a447 Mon Sep 17 00:00:00 2001 From: Vimal Date: Mon, 22 Oct 2018 16:44:21 +0530 Subject: Adding CoinSwitch exchange --- ui/app/components/modals/deposit-ether-modal.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'ui/app/components') diff --git a/ui/app/components/modals/deposit-ether-modal.js b/ui/app/components/modals/deposit-ether-modal.js index 09137d39a..6686eaefa 100644 --- a/ui/app/components/modals/deposit-ether-modal.js +++ b/ui/app/components/modals/deposit-ether-modal.js @@ -16,6 +16,8 @@ let COINBASE_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 { @@ -29,6 +31,9 @@ function mapDispatchToProps (dispatch) { toCoinbase: (address) => { dispatch(actions.buyEth({ network: '1', address, amount: 0 })) }, + toCoinSwitch: (address) => { + dispatch(actions.buyEth({ network: '5', address, amount: 0 })) + }, 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) @@ -187,6 +194,20 @@ DepositEtherModal.prototype.render = function () { hide: isTestNetwork || buyingWithShapeshift, }), + 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: { -- cgit