diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-04-20 06:07:15 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-04-20 06:07:15 +0800 |
commit | c858b7058558fb05af350059bb02972aca1ade19 (patch) | |
tree | bd1e47e58c2e13499e586cafa860919367849a8b | |
parent | 8fe113e8d93a413c94d315ffeded01d2445b37dd (diff) | |
download | tangerine-wallet-browser-c858b7058558fb05af350059bb02972aca1ade19.tar tangerine-wallet-browser-c858b7058558fb05af350059bb02972aca1ade19.tar.gz tangerine-wallet-browser-c858b7058558fb05af350059bb02972aca1ade19.tar.bz2 tangerine-wallet-browser-c858b7058558fb05af350059bb02972aca1ade19.tar.lz tangerine-wallet-browser-c858b7058558fb05af350059bb02972aca1ade19.tar.xz tangerine-wallet-browser-c858b7058558fb05af350059bb02972aca1ade19.tar.zst tangerine-wallet-browser-c858b7058558fb05af350059bb02972aca1ade19.zip |
Moved transaction-list into its own component
-rw-r--r-- | ui/app/account-detail.js | 14 | ||||
-rw-r--r-- | ui/app/components/transaction-list.js | 49 |
2 files changed, 55 insertions, 8 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index b8d4100de..ec3ca0005 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -5,6 +5,7 @@ const connect = require('react-redux').connect const copyToClipboard = require('copy-to-clipboard') const actions = require('./actions') const AccountPanel = require('./components/account-panel') +const transactionList = require('./components/transaction-list') module.exports = connect(mapStateToProps)(AccountDetailScreen) @@ -15,6 +16,7 @@ function mapStateToProps(state) { accounts: state.metamask.accounts, address: state.appState.currentView.context, accountDetail: accountDetail, + transactions: state.metamask.transactions, } } @@ -29,6 +31,7 @@ AccountDetailScreen.prototype.render = function() { var identity = state.identities[state.address] var account = state.accounts[state.address] var accountDetail = state.accountDetail + var transactions = state.transactions return ( @@ -78,14 +81,9 @@ AccountDetailScreen.prototype.render = function() { h('div.font-small','Transaction'), h('div.font-small','Amount'), ]), - h('.flex-row.flex-space-around', [ - // h('div'['href','0xfc37bda95ce571bd0a393e8e7f6da394f1420a57b7d53f7c93821bff61f9b580'), - h('a.font-small', - {href: 'http://testnet.etherscan.io/tx/0xfc37bda95ce571bd0a393e8e7f6da394f1420a57b7d53f7c93821bff61f9b580', - target: '_blank'}, - '0xfc37bda...b580'), - h('div.font-small','0.5000 ETH'), - ]), + + transactionList(transactions), + ]), this.exportedAccount(accountDetail), diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js new file mode 100644 index 000000000..d1cdf8604 --- /dev/null +++ b/ui/app/components/transaction-list.js @@ -0,0 +1,49 @@ +/* +transactions +: +Array[3] +0 +: +Object +id +: +1461025348948185 +status +: +"confirmed" +time +: +1461025348948 +txParams +: +Object +data +: +"0x90b98a11000000000000000000000000c5b8dbac4c1d3f152cdeb400e2313f309c410acb00000000000000000000000000000000000000000000000000000000000003e8" +from +: +"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" +to +: +"0xcd1ca6275b45065c4db4ec024859f8fd9d8d44ba" +__proto__ +: +Object +*/ +const h = require('react-hyperscript') + +module.exports = function(transactions) { + return h('.tx-list', + transactions.map((transaction) => { + return h('.tx.flex-row.flex-space-around', [ + h('a.font-small', + { + href: 'http://testnet.etherscan.io/tx/0xfc37bda95ce571bd0a393e8e7f6da394f1420a57b7d53f7c93821bff61f9b580', + target: '_blank', + }, + '0xfc37bda...b580'), + h('div.font-small', '0.5000 ETH') + ]) + }) + ) +} |