aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/tx-list.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/tx-list.js
parent650b716f55fcfa809b22708b9ad43c8a0716f9fc (diff)
downloadtangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.gz
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/tx-list.js')
-rw-r--r--ui/app/components/tx-list.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js
index 5f09d887e..fa01c7b29 100644
--- a/ui/app/components/tx-list.js
+++ b/ui/app/components/tx-list.js
@@ -1,5 +1,6 @@
const Component = require('react').Component
-const connect = require('../metamask-connect')
+const PropTypes = require('prop-types')
+const connect = require('react-redux').connect
const h = require('react-hyperscript')
const inherits = require('util').inherits
const prefixForNetwork = require('../../lib/etherscan-prefix-for-network')
@@ -11,8 +12,13 @@ const { showConfTxPage } = require('../actions')
const classnames = require('classnames')
const { tokenInfoGetter } = require('../token-util')
+TxList.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxList)
+
function mapStateToProps (state) {
return {
txsToRender: selectors.transactionsSelector(state),
@@ -39,7 +45,7 @@ TxList.prototype.render = function () {
return h('div.flex-column', [
h('div.flex-row.tx-list-header-wrapper', [
h('div.flex-row.tx-list-header', [
- h('div', this.props.t('transactions')),
+ h('div', this.context.t('transactions')),
]),
]),
h('div.flex-column.tx-list-container', {}, [
@@ -56,7 +62,7 @@ TxList.prototype.renderTransaction = function () {
: [h(
'div.tx-list-item.tx-list-item--empty',
{ key: 'tx-list-none' },
- [ this.props.t('noTransactions') ],
+ [ this.context.t('noTransactions') ],
)]
}
@@ -110,7 +116,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
if (isUnapproved) {
opts.onClick = () => showConfTxPage({ id: transactionId })
- opts.transactionStatus = this.props.t('notStarted')
+ opts.transactionStatus = this.context.t('notStarted')
} else if (transactionHash) {
opts.onClick = () => this.view(transactionHash, transactionNetworkId)
}