aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/tx-list.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-08-30 11:16:30 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-08 01:25:56 +0800
commit6d3b3d42034c88475cd90172ddd97b95f04df60e (patch)
treec4ce6e5d95fa237d7d5545253b25ec371b26b24a /ui/app/components/tx-list.js
parentaa60944e30b7d1d9680b5ca53e8b61a8edb47904 (diff)
downloadtangerine-wallet-browser-6d3b3d42034c88475cd90172ddd97b95f04df60e.tar.gz
tangerine-wallet-browser-6d3b3d42034c88475cd90172ddd97b95f04df60e.tar.zst
tangerine-wallet-browser-6d3b3d42034c88475cd90172ddd97b95f04df60e.zip
Show confirm transaction screen when clicking a pending transaction in the list.
Diffstat (limited to 'ui/app/components/tx-list.js')
-rw-r--r--ui/app/components/tx-list.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/ui/app/components/tx-list.js b/ui/app/components/tx-list.js
index 04d2eaa79..6cbd123f8 100644
--- a/ui/app/components/tx-list.js
+++ b/ui/app/components/tx-list.js
@@ -5,8 +5,9 @@ const inherits = require('util').inherits
const selectors = require('../selectors')
const Identicon = require('./identicon')
const { formatBalance, formatDate } = require('../util')
+const { showConfTxPage } = require('../actions')
-module.exports = connect(mapStateToProps)(TxList)
+module.exports = connect(mapStateToProps, mapDispatchToProps)(TxList)
function mapStateToProps (state) {
return {
@@ -15,6 +16,12 @@ function mapStateToProps (state) {
}
}
+function mapDispatchToProps (dispatch) {
+ return {
+ showConfTxPage: ({ id }) => dispatch(showConfTxPage({ id }))
+ }
+}
+
inherits(TxList, Component)
function TxList () {
Component.call(this)
@@ -22,7 +29,7 @@ function TxList () {
TxList.prototype.render = function () {
- // console.log('transactions to render', txsToRender)
+ const { txsToRender, showConfTxPage } = this.props
return h('div.flex-column.tx-list-container', {}, [
@@ -73,18 +80,23 @@ TxList.prototype.renderTransactionListItem = function (transaction) {
address: transaction.txParams.to,
transactionStatus: transaction.status,
transactionAmount: formatBalance(transaction.txParams.value, 6),
+ transActionId: transaction.id,
}
+
const {
address,
transactionStatus,
transactionAmount,
dateString,
+ transActionId,
} = props
+ const { showConfTxPage } = this.props
return h('div.tx-list-item', {
key: transaction.id,
}, [
h('div.flex-column.tx-list-item__wrapper', {
+ onClick: () => transactionStatus === 'unapproved' && showConfTxPage({id: transActionId}),
style: {},
}, [