aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-05-20 08:51:09 +0800
committerDan Finlay <somniac@me.com>2016-05-20 08:51:09 +0800
commit5b30f07d596c9ec24481d6aba5e9f7985c0a4384 (patch)
treef677f90bf9f5d8bb09311473bd191bed8e14d1cc
parent21dd806b270ede40c848ef97fea27139d22597ca (diff)
parentd861c6ceca5ce64191a6922c7694a8c8607a52ca (diff)
downloadtangerine-wallet-browser-5b30f07d596c9ec24481d6aba5e9f7985c0a4384.tar
tangerine-wallet-browser-5b30f07d596c9ec24481d6aba5e9f7985c0a4384.tar.gz
tangerine-wallet-browser-5b30f07d596c9ec24481d6aba5e9f7985c0a4384.tar.bz2
tangerine-wallet-browser-5b30f07d596c9ec24481d6aba5e9f7985c0a4384.tar.lz
tangerine-wallet-browser-5b30f07d596c9ec24481d6aba5e9f7985c0a4384.tar.xz
tangerine-wallet-browser-5b30f07d596c9ec24481d6aba5e9f7985c0a4384.tar.zst
tangerine-wallet-browser-5b30f07d596c9ec24481d6aba5e9f7985c0a4384.zip
Merge pull request #196 from MetaMask/ContractsTransactionList
Add UI for published contracts in tx list
-rw-r--r--ui/app/components/transaction-list.js53
1 files changed, 39 insertions, 14 deletions
diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js
index 40a4593fe..5e9ec8b87 100644
--- a/ui/app/components/transaction-list.js
+++ b/ui/app/components/transaction-list.js
@@ -85,7 +85,7 @@ module.exports = function(transactions, network) {
var txParams = transaction.txParams
var date = formatDate(transaction.time)
- return (
+ return (
h('.transaction-list-item.flex-row.flex-space-between.cursor-pointer', {
key: `tx-${transaction.hash}`,
@@ -100,36 +100,61 @@ module.exports = function(transactions, network) {
// large identicon
h('.identicon-wrapper.flex-column.flex-center.select-none', [
- h(Identicon, {
- diameter: 24,
- address: txParams.to,
- }),
+ identicon(txParams, transaction),
]),
h('.flex-column', [
h('div', date),
- h('div', {
- style: {
- fontSize: 'small',
- color: '#ABA9AA',
- },
- }, addressSummary(txParams.to)),
+ recipientField(txParams),
]),
h(EtherBalance, {
value: txParams.value,
}),
-
])
)
}
+}
+
+function recipientField(txParams) {
+ if (txParams.to) {
+ return h('div', {
+ style: {
+ fontSize: 'small',
+ color: '#ABA9AA',
+ },
+ }, addressSummary(txParams.to))
- }
+ } else {
+
+ return h('div', {
+ style: {
+ fontSize: 'small',
+ color: '#ABA9AA',
+ },
+ }, 'Contract Published')
+ }
+}
function formatDate(date){
return vreme.format(new Date(date), 'March 16 2014 14:30')
-} \ No newline at end of file
+}
+
+function identicon(txParams, transaction) {
+ if (txParams.to) {
+ return h(Identicon, {
+ diameter: 24,
+ address: txParams.to || transaction.hash,
+ })
+ } else {
+ return h('i.fa.fa-file-text-o.fa-lg', {
+ style: {
+ width: '24px',
+ }
+ })
+ }
+}