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

ui - txList - add time

This commit is contained in:
kumavis 2016-05-13 17:02:33 -07:00
parent 2365fe1142
commit 82504ae965
2 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,7 @@
"textarea-caret": "^3.0.1", "textarea-caret": "^3.0.1",
"three.js": "^0.73.2", "three.js": "^0.73.2",
"through2": "^2.0.1", "through2": "^2.0.1",
"vreme": "^3.0.2",
"web3": "ethereum/web3.js#0.16.0", "web3": "ethereum/web3.js#0.16.0",
"web3-provider-engine": "^7.6.3", "web3-provider-engine": "^7.6.3",
"xtend": "^4.0.1" "xtend": "^4.0.1"

View File

@ -1,4 +1,5 @@
const h = require('react-hyperscript') const h = require('react-hyperscript')
const vreme = new (require('vreme'))
const formatBalance = require('../util').formatBalance const formatBalance = require('../util').formatBalance
const addressSummary = require('../util').addressSummary const addressSummary = require('../util').addressSummary
const explorerLink = require('../../lib/explorer-link') const explorerLink = require('../../lib/explorer-link')
@ -12,6 +13,7 @@ module.exports = function(transactions, network) {
h('h3.flex-center.text-transform-uppercase', { h('h3.flex-center.text-transform-uppercase', {
style: { style: {
background: '#EBEBEB', background: '#EBEBEB',
color: '#AEAEAE',
}, },
}, [ }, [
'Transactions', 'Transactions',
@ -43,6 +45,7 @@ module.exports = function(transactions, network) {
} }
function renderTransaction(transaction){ function renderTransaction(transaction){
var panelOpts = { var panelOpts = {
key: `tx-${transaction.hash}`, key: `tx-${transaction.hash}`,
identiconKey: transaction.txParams.to, identiconKey: transaction.txParams.to,
@ -51,6 +54,10 @@ function renderTransaction(transaction){
chrome.tabs.create({ url }) chrome.tabs.create({ url })
}, },
attributes: [ attributes: [
{
key: 'TIME',
value: formatDate(transaction.time),
},
{ {
key: 'TO', key: 'TO',
value: addressSummary(transaction.txParams.to), value: addressSummary(transaction.txParams.to),
@ -64,3 +71,7 @@ function renderTransaction(transaction){
return h(Panel, panelOpts) return h(Panel, panelOpts)
} }
function formatDate(date){
return vreme.format(new Date(date), 'March 16 2014 14:30')
}