aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/shift-list-item.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/shift-list-item.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/shift-list-item.js')
-rw-r--r--ui/app/components/shift-list-item.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js
index d810eddc9..4334aacba 100644
--- a/ui/app/components/shift-list-item.js
+++ b/ui/app/components/shift-list-item.js
@@ -1,7 +1,8 @@
const inherits = require('util').inherits
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 vreme = new (require('vreme'))()
const explorerLink = require('etherscan-link').createExplorerLink
const actions = require('../actions')
@@ -12,8 +13,13 @@ const EthBalance = require('./eth-balance')
const Tooltip = require('./tooltip')
+ShiftListItem.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = connect(mapStateToProps)(ShiftListItem)
+
function mapStateToProps (state) {
return {
selectedAddress: state.metamask.selectedAddress,
@@ -75,7 +81,7 @@ ShiftListItem.prototype.renderUtilComponents = function () {
value: this.props.depositAddress,
}),
h(Tooltip, {
- title: this.props.t('qrCode'),
+ title: this.context.t('qrCode'),
}, [
h('i.fa.fa-qrcode.pointer.pop-hover', {
onClick: () => props.dispatch(actions.reshowQrCode(props.depositAddress, props.depositType)),
@@ -135,8 +141,8 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA',
width: '100%',
},
- }, this.props.t('toETHviaShapeShift', [props.depositType])),
- h('div', this.props.t('noDeposits')),
+ }, this.context.t('toETHviaShapeShift', [props.depositType])),
+ h('div', this.context.t('noDeposits')),
h('div', {
style: {
fontSize: 'x-small',
@@ -158,8 +164,8 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA',
width: '100%',
},
- }, this.props.t('toETHviaShapeShift', [props.depositType])),
- h('div', this.props.t('conversionProgress')),
+ }, this.context.t('toETHviaShapeShift', [props.depositType])),
+ h('div', this.context.t('conversionProgress')),
h('div', {
style: {
fontSize: 'x-small',
@@ -184,7 +190,7 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA',
width: '100%',
},
- }, this.props.t('fromShapeShift')),
+ }, this.context.t('fromShapeShift')),
h('div', formatDate(props.time)),
h('div', {
style: {
@@ -196,7 +202,7 @@ ShiftListItem.prototype.renderInfo = function () {
])
case 'failed':
- return h('span.error', '(' + this.props.t('failed') + ')')
+ return h('span.error', '(' + this.context.t('failed') + ')')
default:
return ''
}