aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/deposit-ether-modal.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-16 08:29:45 +0800
committerDan <danjm.com@gmail.com>2018-03-16 08:29:45 +0800
commit5fe0be722b6514692a68e920ee8058c5d572237d (patch)
tree58da5c62f17cbd0160d24e44918aa34b4ee23300 /ui/app/components/modals/deposit-ether-modal.js
parenteb5a84975b490664aa6238be6ceab3d4749167ee (diff)
downloadtangerine-wallet-browser-5fe0be722b6514692a68e920ee8058c5d572237d.tar.gz
tangerine-wallet-browser-5fe0be722b6514692a68e920ee8058c5d572237d.tar.zst
tangerine-wallet-browser-5fe0be722b6514692a68e920ee8058c5d572237d.zip
Handle i18n with redux.
Diffstat (limited to 'ui/app/components/modals/deposit-ether-modal.js')
-rw-r--r--ui/app/components/modals/deposit-ether-modal.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/ui/app/components/modals/deposit-ether-modal.js b/ui/app/components/modals/deposit-ether-modal.js
index 03304207e..3984e2c7b 100644
--- a/ui/app/components/modals/deposit-ether-modal.js
+++ b/ui/app/components/modals/deposit-ether-modal.js
@@ -1,11 +1,11 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
-const connect = require('react-redux').connect
+const connect = require('../../metamask-connect')
const actions = require('../../actions')
const networkNames = require('../../../../app/scripts/config.js').networkNames
const ShapeshiftForm = require('../shapeshift-form')
-const t = global.getMessage
+const t = require('../../../i18n-helper').getMessage
let DIRECT_DEPOSIT_ROW_TITLE
let DIRECT_DEPOSIT_ROW_TEXT
@@ -16,7 +16,7 @@ let SHAPESHIFT_ROW_TEXT
let FAUCET_ROW_TITLE
const facuetRowText = (networkName) => {
- return t('getEtherFromFaucet', [networkName])
+ return t(this.props.localeMessages, 'getEtherFromFaucet', [networkName])
}
function mapStateToProps (state) {
@@ -49,13 +49,13 @@ function DepositEtherModal () {
Component.call(this)
// need to set after i18n locale has loaded
- DIRECT_DEPOSIT_ROW_TITLE = t('directDepositEther')
- DIRECT_DEPOSIT_ROW_TEXT = t('directDepositEtherExplainer')
- COINBASE_ROW_TITLE = t('buyCoinbase')
- COINBASE_ROW_TEXT = t('buyCoinbaseExplainer')
- SHAPESHIFT_ROW_TITLE = t('depositShapeShift')
- SHAPESHIFT_ROW_TEXT = t('depositShapeShiftExplainer')
- FAUCET_ROW_TITLE = t('testFaucet')
+ DIRECT_DEPOSIT_ROW_TITLE = t(this.props.localeMessages, 'directDepositEther')
+ DIRECT_DEPOSIT_ROW_TEXT = t(this.props.localeMessages, 'directDepositEtherExplainer')
+ COINBASE_ROW_TITLE = t(this.props.localeMessages, 'buyCoinbase')
+ COINBASE_ROW_TEXT = t(this.props.localeMessages, 'buyCoinbaseExplainer')
+ SHAPESHIFT_ROW_TITLE = t(this.props.localeMessages, 'depositShapeShift')
+ SHAPESHIFT_ROW_TEXT = t(this.props.localeMessages, 'depositShapeShiftExplainer')
+ FAUCET_ROW_TITLE = t(this.props.localeMessages, 'testFaucet')
this.state = {
buyingWithShapeshift: false,
@@ -126,7 +126,7 @@ DepositEtherModal.prototype.render = function () {
h('div.page-container__title', [t('depositEther')]),
h('div.page-container__subtitle', [
- t('needEtherInWallet'),
+ t(this.props.localeMessages, 'needEtherInWallet'),
]),
h('div.page-container__header-close', {
@@ -147,7 +147,7 @@ DepositEtherModal.prototype.render = function () {
logo: h('img.deposit-ether-modal__buy-row__eth-logo', { src: '../../../images/eth_logo.svg' }),
title: DIRECT_DEPOSIT_ROW_TITLE,
text: DIRECT_DEPOSIT_ROW_TEXT,
- buttonLabel: t('viewAccount'),
+ buttonLabel: t(this.props.localeMessages, 'viewAccount'),
onButtonClick: () => this.goToAccountDetailsModal(),
hide: buyingWithShapeshift,
}),
@@ -156,7 +156,7 @@ DepositEtherModal.prototype.render = function () {
logo: h('i.fa.fa-tint.fa-2x'),
title: FAUCET_ROW_TITLE,
text: facuetRowText(networkName),
- buttonLabel: t('getEther'),
+ buttonLabel: t(this.props.localeMessages, 'getEther'),
onButtonClick: () => toFaucet(network),
hide: !isTestNetwork || buyingWithShapeshift,
}),
@@ -170,7 +170,7 @@ DepositEtherModal.prototype.render = function () {
}),
title: COINBASE_ROW_TITLE,
text: COINBASE_ROW_TEXT,
- buttonLabel: t('continueToCoinbase'),
+ buttonLabel: t(this.props.localeMessages, 'continueToCoinbase'),
onButtonClick: () => toCoinbase(address),
hide: isTestNetwork || buyingWithShapeshift,
}),
@@ -183,7 +183,7 @@ DepositEtherModal.prototype.render = function () {
}),
title: SHAPESHIFT_ROW_TITLE,
text: SHAPESHIFT_ROW_TEXT,
- buttonLabel: t('shapeshiftBuy'),
+ buttonLabel: t(this.props.localeMessages, 'shapeshiftBuy'),
onButtonClick: () => this.setState({ buyingWithShapeshift: true }),
hide: isTestNetwork,
hideButton: buyingWithShapeshift,