aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/tx-list-item.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-30 10:30:31 +0800
committerDan <danjm.com@gmail.com>2018-03-30 10:30:31 +0800
commit717623e2e388f488d71bd6e19095645cd8095a99 (patch)
tree7c16960c017585e2823c927199c4b98b93aecbbd /ui/app/components/tx-list-item.js
parent01e3293b65bb153325479f7366113e037fee659b (diff)
parent9d4be1842e7c56e3bfde529ff555dcae8dec3dbd (diff)
downloadtangerine-wallet-browser-717623e2e388f488d71bd6e19095645cd8095a99.tar.gz
tangerine-wallet-browser-717623e2e388f488d71bd6e19095645cd8095a99.tar.zst
tangerine-wallet-browser-717623e2e388f488d71bd6e19095645cd8095a99.zip
Merge branch 'master' into i3686-txparamundefined-sigrequestsintxlist
Diffstat (limited to 'ui/app/components/tx-list-item.js')
-rw-r--r--ui/app/components/tx-list-item.js28
1 files changed, 17 insertions, 11 deletions
diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js
index 116813547..42c008798 100644
--- a/ui/app/components/tx-list-item.js
+++ b/ui/app/components/tx-list-item.js
@@ -1,6 +1,7 @@
const Component = require('react').Component
+const PropTypes = require('prop-types')
const h = require('react-hyperscript')
-const connect = require('../metamask-connect')
+const connect = require('react-redux').connect
const inherits = require('util').inherits
const classnames = require('classnames')
const abi = require('human-standard-token-abi')
@@ -15,8 +16,13 @@ const { calcTokenAmount } = require('../token-util')
const { getCurrentCurrency } = require('../selectors')
+TxListItem.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxListItem)
+
function mapStateToProps (state) {
return {
tokens: state.metamask.tokens,
@@ -74,9 +80,9 @@ TxListItem.prototype.getAddressText = function () {
const addressToRender = txDataName === 'transfer' ? value : address
addressText = `${addressToRender.slice(0, 10)}...${addressToRender.slice(-4)}`
} else if (isMsg) {
- addressText = this.props.t('sigRequest')
+ addressText = this.context.t('sigRequest')
} else {
- addressText = this.props.t('contractDeployment')
+ addressText = this.context.t('contractDeployment')
}
return addressText
@@ -313,21 +319,21 @@ TxListItem.prototype.txStatusIndicator = function () {
let name
if (transactionStatus === 'unapproved') {
- name = this.props.t('unapproved')
+ name = this.context.t('unapproved')
} else if (transactionStatus === 'rejected') {
- name = this.props.t('rejected')
+ name = this.context.t('rejected')
} else if (transactionStatus === 'approved') {
- name = this.props.t('approved')
+ name = this.context.t('approved')
} else if (transactionStatus === 'signed') {
- name = this.props.t('signed')
+ name = this.context.t('signed')
} else if (transactionStatus === 'submitted') {
- name = this.props.t('submitted')
+ name = this.context.t('submitted')
} else if (transactionStatus === 'confirmed') {
- name = this.props.t('confirmed')
+ name = this.context.t('confirmed')
} else if (transactionStatus === 'failed') {
- name = this.props.t('failed')
+ name = this.context.t('failed')
} else if (transactionStatus === 'dropped') {
- name = this.props.t('dropped')
+ name = this.context.t('dropped')
}
return name
}