aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/dropdowns
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/dropdowns')
-rw-r--r--ui/app/components/dropdowns/components/account-dropdowns.js23
-rw-r--r--ui/app/components/dropdowns/network-dropdown.js30
-rw-r--r--ui/app/components/dropdowns/token-menu-dropdown.js6
3 files changed, 30 insertions, 29 deletions
diff --git a/ui/app/components/dropdowns/components/account-dropdowns.js b/ui/app/components/dropdowns/components/account-dropdowns.js
index e5359c1d6..5e7c0d554 100644
--- a/ui/app/components/dropdowns/components/account-dropdowns.js
+++ b/ui/app/components/dropdowns/components/account-dropdowns.js
@@ -3,14 +3,14 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const actions = require('../../../actions')
const genAccountLink = require('../../../../lib/account-link.js')
-const connect = require('react-redux').connect
+const connect = require('../../../metamask-connect')
const Dropdown = require('./dropdown').Dropdown
const DropdownMenuItem = require('./dropdown').DropdownMenuItem
const Identicon = require('../../identicon')
const ethUtil = require('ethereumjs-util')
const copyToClipboard = require('copy-to-clipboard')
const { formatBalance } = require('../../../util')
-const t = require('../../../../i18n')
+
class AccountDropdowns extends Component {
constructor (props) {
@@ -130,7 +130,7 @@ class AccountDropdowns extends Component {
actions.showEditAccountModal(identity)
},
}, [
- t('edit'),
+ this.props.t('edit'),
]),
]),
@@ -144,7 +144,7 @@ class AccountDropdowns extends Component {
try { // Sometimes keyrings aren't loaded yet:
const type = keyring.type
const isLoose = type !== 'HD Key Tree'
- return isLoose ? h('.keyring-label.allcaps', t('loose')) : null
+ return isLoose ? h('.keyring-label.allcaps', this.props.t('loose')) : null
} catch (e) { return }
}
@@ -202,7 +202,7 @@ class AccountDropdowns extends Component {
fontSize: '16px',
lineHeight: '23px',
},
- }, t('createAccount')),
+ }, this.props.t('createAccount')),
],
),
h(
@@ -236,7 +236,7 @@ class AccountDropdowns extends Component {
fontSize: '16px',
lineHeight: '23px',
},
- }, t('importAccount')),
+ }, this.props.t('importAccount')),
]
),
]
@@ -287,7 +287,7 @@ class AccountDropdowns extends Component {
menuItemStyles,
),
},
- t('accountDetails'),
+ this.props.t('accountDetails'),
),
h(
DropdownMenuItem,
@@ -303,7 +303,7 @@ class AccountDropdowns extends Component {
menuItemStyles,
),
},
- t('etherscanView'),
+ this.props.t('etherscanView'),
),
h(
DropdownMenuItem,
@@ -319,7 +319,7 @@ class AccountDropdowns extends Component {
menuItemStyles,
),
},
- t('copyAddress'),
+ this.props.t('copyAddress'),
),
h(
DropdownMenuItem,
@@ -331,7 +331,7 @@ class AccountDropdowns extends Component {
menuItemStyles,
),
},
- t('exportPrivateKey'),
+ this.props.t('exportPrivateKey'),
),
h(
DropdownMenuItem,
@@ -346,7 +346,7 @@ class AccountDropdowns extends Component {
menuItemStyles,
),
},
- t('addToken'),
+ this.props.t('addToken'),
),
]
@@ -425,6 +425,7 @@ AccountDropdowns.propTypes = {
enableAccountsSelector: PropTypes.bool,
enableAccountOption: PropTypes.bool,
enableAccountOptions: PropTypes.bool,
+ t: PropTypes.func,
}
const mapDispatchToProps = (dispatch) => {
diff --git a/ui/app/components/dropdowns/network-dropdown.js b/ui/app/components/dropdowns/network-dropdown.js
index 5afe730c1..aac7a9ee5 100644
--- a/ui/app/components/dropdowns/network-dropdown.js
+++ b/ui/app/components/dropdowns/network-dropdown.js
@@ -1,14 +1,14 @@
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 Dropdown = require('./components/dropdown').Dropdown
const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem
const NetworkDropdownIcon = require('./components/network-dropdown-icon')
-const t = require('../../../i18n')
const R = require('ramda')
+
// classes from nodes of the toggle element.
const notToggleElementClassnames = [
'menu-icon',
@@ -94,13 +94,13 @@ NetworkDropdown.prototype.render = function () {
}, [
h('div.network-dropdown-header', {}, [
- h('div.network-dropdown-title', {}, t('networks')),
+ h('div.network-dropdown-title', {}, this.props.t('networks')),
h('div.network-dropdown-divider'),
h('div.network-dropdown-content',
{},
- t('defaultNetwork')
+ this.props.t('defaultNetwork')
),
]),
@@ -122,7 +122,7 @@ NetworkDropdown.prototype.render = function () {
style: {
color: providerType === 'mainnet' ? '#ffffff' : '#9b9b9b',
},
- }, t('mainnet')),
+ }, this.props.t('mainnet')),
]
),
@@ -144,7 +144,7 @@ NetworkDropdown.prototype.render = function () {
style: {
color: providerType === 'ropsten' ? '#ffffff' : '#9b9b9b',
},
- }, t('ropsten')),
+ }, this.props.t('ropsten')),
]
),
@@ -166,7 +166,7 @@ NetworkDropdown.prototype.render = function () {
style: {
color: providerType === 'kovan' ? '#ffffff' : '#9b9b9b',
},
- }, t('kovan')),
+ }, this.props.t('kovan')),
]
),
@@ -188,7 +188,7 @@ NetworkDropdown.prototype.render = function () {
style: {
color: providerType === 'rinkeby' ? '#ffffff' : '#9b9b9b',
},
- }, t('rinkeby')),
+ }, this.props.t('rinkeby')),
]
),
@@ -210,7 +210,7 @@ NetworkDropdown.prototype.render = function () {
style: {
color: activeNetwork === 'http://localhost:8545' ? '#ffffff' : '#9b9b9b',
},
- }, t('localhost')),
+ }, this.props.t('localhost')),
]
),
@@ -234,7 +234,7 @@ NetworkDropdown.prototype.render = function () {
style: {
color: activeNetwork === 'custom' ? '#ffffff' : '#9b9b9b',
},
- }, t('customRPC')),
+ }, this.props.t('customRPC')),
]
),
@@ -249,15 +249,15 @@ NetworkDropdown.prototype.getNetworkName = function () {
let name
if (providerName === 'mainnet') {
- name = t('mainnet')
+ name = this.props.t('mainnet')
} else if (providerName === 'ropsten') {
- name = t('ropsten')
+ name = this.props.t('ropsten')
} else if (providerName === 'kovan') {
- name = t('kovan')
+ name = this.props.t('kovan')
} else if (providerName === 'rinkeby') {
- name = t('rinkeby')
+ name = this.props.t('rinkeby')
} else {
- name = t('unknownNetwork')
+ name = this.props.t('unknownNetwork')
}
return name
diff --git a/ui/app/components/dropdowns/token-menu-dropdown.js b/ui/app/components/dropdowns/token-menu-dropdown.js
index a4f93b505..630e1f99d 100644
--- a/ui/app/components/dropdowns/token-menu-dropdown.js
+++ b/ui/app/components/dropdowns/token-menu-dropdown.js
@@ -1,9 +1,9 @@
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 t = require('../../../i18n')
+
module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown)
@@ -44,7 +44,7 @@ TokenMenuDropdown.prototype.render = function () {
showHideTokenConfirmationModal(this.props.token)
this.props.onClose()
},
- }, t('hideToken')),
+ }, this.props.t('hideToken')),
]),
]),