aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-03-20 03:02:34 +0800
committerDan Finlay <dan@danfinlay.com>2018-03-20 03:03:35 +0800
commit293ca6c9a630b939c97e4939e0416a57d8bad79c (patch)
tree195a1e843dc57dd91dff51ef318a36073f27daa4 /ui
parent2e7d4db2dec000d31ad967400d25b46aabf70e29 (diff)
downloadtangerine-wallet-browser-293ca6c9a630b939c97e4939e0416a57d8bad79c.tar.gz
tangerine-wallet-browser-293ca6c9a630b939c97e4939e0416a57d8bad79c.tar.zst
tangerine-wallet-browser-293ca6c9a630b939c97e4939e0416a57d8bad79c.zip
Add template for settings and info
Diffstat (limited to 'ui')
-rw-r--r--ui/app/settings.js48
1 files changed, 25 insertions, 23 deletions
diff --git a/ui/app/settings.js b/ui/app/settings.js
index 466f739d5..60d68bfed 100644
--- a/ui/app/settings.js
+++ b/ui/app/settings.js
@@ -10,6 +10,7 @@ const TabBar = require('./components/tab-bar')
const SimpleDropdown = require('./components/dropdowns/simple-dropdown')
const ToggleButton = require('react-toggle-button')
const { OLD_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums
+const t = require('../i18n')
const getInfuraCurrencyOptions = () => {
const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => {
@@ -44,8 +45,8 @@ class Settings extends Component {
return h('div.settings__tabs', [
h(TabBar, {
tabs: [
- { content: 'Settings', key: 'settings' },
- { content: 'Info', key: 'info' },
+ { content: t('settings'), key: 'settings' },
+ { content: t('info'), key: 'info' },
],
defaultTab: activeTab,
tabSelected: key => this.setState({ activeTab: key }),
@@ -84,7 +85,7 @@ class Settings extends Component {
h('div.settings__content-item', [
h('div.settings__content-item-col', [
h(SimpleDropdown, {
- placeholder: 'Select Currency',
+ placeholder: t('selectCurrency'),
options: getInfuraCurrencyOptions(),
selectedOption: currentCurrency,
onSelect: newCurrency => setCurrentCurrency(newCurrency),
@@ -101,31 +102,31 @@ class Settings extends Component {
switch (provider.type) {
case 'mainnet':
- title = 'Current Network'
- value = 'Main Ethereum Network'
+ title = t('currentNetwork')
+ value = t('mainnet')
color = '#038789'
break
case 'ropsten':
- title = 'Current Network'
- value = 'Ropsten Test Network'
+ title = t('currentNetwork')
+ value = t('ropsten')
color = '#e91550'
break
case 'kovan':
- title = 'Current Network'
- value = 'Kovan Test Network'
+ title = t('currentNetwork')
+ value = t('kovan')
color = '#690496'
break
case 'rinkeby':
- title = 'Current Network'
- value = 'Rinkeby Test Network'
+ title = t('currentNetwork')
+ value = t('rinkeby')
color = '#ebb33f'
break
default:
- title = 'Current RPC'
+ title = t('currentRpc')
value = provider.rpcTarget
}
@@ -146,12 +147,12 @@ class Settings extends Component {
return (
h('div.settings__content-row', [
h('div.settings__content-item', [
- h('span', 'New RPC URL'),
+ h('span', t('newRPC')),
]),
h('div.settings__content-item', [
h('div.settings__content-item-col', [
h('input.settings__input', {
- placeholder: 'New RPC URL',
+ placeholder: t('newRPC'),
onChange: event => this.setState({ newRpc: event.target.value }),
onKeyPress: event => {
if (event.key === 'Enter') {
@@ -164,7 +165,7 @@ class Settings extends Component {
event.preventDefault()
this.validateRpc(this.state.newRpc)
},
- }, 'Save'),
+ }, t('save')),
]),
]),
])
@@ -180,9 +181,9 @@ class Settings extends Component {
const appendedRpc = `http://${newRpc}`
if (validUrl.isWebUri(appendedRpc)) {
- displayWarning('URIs require the appropriate HTTP/HTTPS prefix.')
+ displayWarning(t('uriErrorMsg'))
} else {
- displayWarning('Invalid RPC URI')
+ displayWarning(t('invalidRPC'))
}
}
}
@@ -194,7 +195,7 @@ class Settings extends Component {
h('div', 'State Logs'),
h(
'div.settings__content-description',
- 'State logs contain your public account addresses and sent transactions.'
+ t('stateLogsDescription')
),
]),
h('div.settings__content-item', [
@@ -203,13 +204,13 @@ class Settings extends Component {
onClick (event) {
window.logStateString((err, result) => {
if (err) {
- this.state.dispatch(actions.displayWarning('Error in retrieving state logs.'))
+ this.state.dispatch(actions.displayWarning(t('stateLogError')))
} else {
exportAsFile('MetaMask State Logs.json', result)
}
})
},
- }, 'Download State Logs'),
+ }, t('downloadStateLogs')),
]),
]),
])
@@ -229,7 +230,7 @@ class Settings extends Component {
event.preventDefault()
revealSeedConfirmation()
},
- }, 'Reveal Seed Words'),
+ }, t('revealSeedWords')),
]),
]),
])
@@ -249,7 +250,7 @@ class Settings extends Component {
event.preventDefault()
setFeatureFlagToBeta()
},
- }, 'Use old UI'),
+ }, t('useOldUI')),
]),
]),
])
@@ -268,7 +269,7 @@ class Settings extends Component {
event.preventDefault()
showResetAccountConfirmationModal()
},
- }, 'Reset Account'),
+ }, t('resetAccount')),
]),
]),
])
@@ -445,3 +446,4 @@ const mapDispatchToProps = dispatch => {
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(Settings)
+