1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Style transaction list using new panel component

This commit is contained in:
Dan Finlay 2016-05-06 14:42:08 -07:00
parent a9fc4f452f
commit 356da540d1
3 changed files with 48 additions and 25 deletions

View File

@ -9,6 +9,7 @@
- Restored back button to account detail view.
- Show transaction list always, never collapsed.
- Changing provider now reloads current Dapps
- Improved appearance of transaction list in account detail view.
## 1.7.0 2016-04-29

View File

@ -50,7 +50,7 @@ AccountsScreen.prototype.render = function() {
* regardless of the current domain.
*/
h('.current-domain-panel.flex-center.font-small', [
h('spam', 'Selected address is visible to all sites you visit.'),
h('span', 'Selected address is visible to all sites you visit.'),
// h('span', state.currentDomain),
]),

View File

@ -2,9 +2,16 @@ const h = require('react-hyperscript')
const formatBalance = require('../util').formatBalance
const addressSummary = require('../util').addressSummary
const explorerLink = require('../../lib/explorer-link')
const Panel = require('./panel')
module.exports = function(transactions, network) {
return h('.tx-list', {
return h('section', [
h('.current-domain-panel.flex-center.font-small', [
h('span', 'Transactions'),
]),
h('.tx-list', {
style: {
overflowY: 'auto',
height: '180px',
@ -13,21 +20,36 @@ module.exports = function(transactions, network) {
},
[
h('div.font-small', {style: {display: 'inline'}}, 'Transactions'),
transactions.map((transaction) => {
return h('.tx.flex-row.flex-space-around', {
key: `listed-tx-${transaction.hash}`,
}, [
h('a.font-small',
{
href: explorerLink(transaction.hash, parseInt(network)),
target: '_blank',
console.dir(transaction)
var panelOpts = {
key: `tx-${transaction.hash}`,
identiconKey: transaction.txParams.to,
style: {
cursor: 'pointer',
},
addressSummary(transaction.txParams.to)),
h('div.font-small', formatBalance(transaction.txParams.value))
])
onClick: (event) => {
var url = explorerLink(transaction.hash, parseInt(network))
chrome.tabs.create({ url });
},
attributes: [
{
key: 'TO',
value: addressSummary(transaction.txParams.to),
},
{
key: 'VALUE',
value: formatBalance(transaction.txParams.value),
},
]
}
return h(Panel, panelOpts)
})
]
)
}
])
}