aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/account-dropdowns.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-29 23:00:44 +0800
committerDan <danjm.com@gmail.com>2018-03-29 23:12:38 +0800
commit0a711f0de0e342b24988a5da4ca5c64342153210 (patch)
tree9dd6014e6389cfad02d5380e6810a12fdf747b0a /ui/app/components/account-dropdowns.js
parent650b716f55fcfa809b22708b9ad43c8a0716f9fc (diff)
downloadtangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.gz
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.bz2
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.lz
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.xz
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.zst
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.zip
Removes t from props via metamask-connect and instead places it on context via a provider.
Diffstat (limited to 'ui/app/components/account-dropdowns.js')
-rw-r--r--ui/app/components/account-dropdowns.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js
index 84678fee6..03955e077 100644
--- a/ui/app/components/account-dropdowns.js
+++ b/ui/app/components/account-dropdowns.js
@@ -3,7 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const actions = require('../actions')
const genAccountLink = require('etherscan-link').createAccountLink
-const connect = require('../metamask-connect')
+const connect = require('react-redux').connect
const Dropdown = require('./dropdown').Dropdown
const DropdownMenuItem = require('./dropdown').DropdownMenuItem
const Identicon = require('./identicon')
@@ -79,7 +79,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', this.props.t('loose')) : null
+ return isLoose ? h('.keyring-label.allcaps', this.context.t('loose')) : null
} catch (e) { return }
}
@@ -129,7 +129,7 @@ class AccountDropdowns extends Component {
diameter: 32,
},
),
- h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, this.props.t('createAccount')),
+ h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, this.context.t('createAccount')),
],
),
h(
@@ -154,7 +154,7 @@ class AccountDropdowns extends Component {
fontSize: '24px',
marginBottom: '5px',
},
- }, this.props.t('importAccount')),
+ }, this.context.t('importAccount')),
]
),
]
@@ -192,7 +192,7 @@ class AccountDropdowns extends Component {
global.platform.openWindow({ url })
},
},
- this.props.t('etherscanView'),
+ this.context.t('etherscanView'),
),
h(
DropdownMenuItem,
@@ -204,7 +204,7 @@ class AccountDropdowns extends Component {
actions.showQrView(selected, identity ? identity.name : '')
},
},
- this.props.t('showQRCode'),
+ this.context.t('showQRCode'),
),
h(
DropdownMenuItem,
@@ -216,7 +216,7 @@ class AccountDropdowns extends Component {
copyToClipboard(checkSumAddress)
},
},
- this.props.t('copyAddress'),
+ this.context.t('copyAddress'),
),
h(
DropdownMenuItem,
@@ -226,7 +226,7 @@ class AccountDropdowns extends Component {
actions.requestAccountExport()
},
},
- this.props.t('exportPrivateKey'),
+ this.context.t('exportPrivateKey'),
),
]
)
@@ -316,6 +316,10 @@ const mapDispatchToProps = (dispatch) => {
}
}
+AccountDropdowns.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = {
AccountDropdowns: connect(null, mapDispatchToProps)(AccountDropdowns),
}