aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-08-23 05:36:21 +0800
committerDan Finlay <dan@danfinlay.com>2016-08-23 05:36:21 +0800
commitf57cbe59fc9e0d3cfb3ee54da749470248fe2b8b (patch)
treee7d702905f2c92cb987148de8247ead5ead31a00 /ui/app/components
parentc223ba2e00ff80913c5b1fe3a339167d4489ec6a (diff)
downloadtangerine-wallet-browser-f57cbe59fc9e0d3cfb3ee54da749470248fe2b8b.tar
tangerine-wallet-browser-f57cbe59fc9e0d3cfb3ee54da749470248fe2b8b.tar.gz
tangerine-wallet-browser-f57cbe59fc9e0d3cfb3ee54da749470248fe2b8b.tar.bz2
tangerine-wallet-browser-f57cbe59fc9e0d3cfb3ee54da749470248fe2b8b.tar.lz
tangerine-wallet-browser-f57cbe59fc9e0d3cfb3ee54da749470248fe2b8b.tar.xz
tangerine-wallet-browser-f57cbe59fc9e0d3cfb3ee54da749470248fe2b8b.tar.zst
tangerine-wallet-browser-f57cbe59fc9e0d3cfb3ee54da749470248fe2b8b.zip
Removed view more button, added account info button.
Also: - Also fixed bug that caused React warning when rendering the tx history. - Renamed 'Transactions' to 'History', since it now has more than that.
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/account-info-link.js42
-rw-r--r--ui/app/components/shift-list-item.js4
-rw-r--r--ui/app/components/transaction-list-item.js1
-rw-r--r--ui/app/components/transaction-list.js28
4 files changed, 58 insertions, 17 deletions
diff --git a/ui/app/components/account-info-link.js b/ui/app/components/account-info-link.js
new file mode 100644
index 000000000..4fe3b8b5d
--- /dev/null
+++ b/ui/app/components/account-info-link.js
@@ -0,0 +1,42 @@
+const Component = require('react').Component
+const h = require('react-hyperscript')
+const inherits = require('util').inherits
+const Tooltip = require('./tooltip')
+const genAccountLink = require('../../lib/account-link')
+const extension = require('../../../app/scripts/lib/extension')
+
+module.exports = AccountInfoLink
+
+inherits(AccountInfoLink, Component)
+function AccountInfoLink () {
+ Component.call(this)
+}
+
+AccountInfoLink.prototype.render = function () {
+ const { selected, network } = this.props
+ const title = 'View account on etherscan'
+ const url = genAccountLink(selected, network)
+
+ if (!url) {
+ return null
+ }
+
+ return h('.account-info-link', {
+ style: {
+ display: 'flex',
+ alignItems: 'center',
+ },
+ }, [
+
+ h(Tooltip, {
+ title,
+ }, [
+ h('i.fa.fa-info-circle.cursor-pointer.color-orange', {
+ style: {
+ margin: '5px',
+ },
+ onClick () { extension.tabs.create({ url }) },
+ }),
+ ]),
+ ])
+}
diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js
index 11e11cd37..c92181d5d 100644
--- a/ui/app/components/shift-list-item.js
+++ b/ui/app/components/shift-list-item.js
@@ -26,6 +26,10 @@ function ShiftListItem () {
}
ShiftListItem.prototype.render = function () {
+ var props = this.props
+ const { depositAddress, time, i, response } = props
+ const { transaction } = response
+
return (
h('.transaction-list-item.flex-row', {
style: {
diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js
index b03ca11ad..2cd0f0897 100644
--- a/ui/app/components/transaction-list-item.js
+++ b/ui/app/components/transaction-list-item.js
@@ -44,7 +44,6 @@ TransactionListItem.prototype.render = function () {
return (
h(`.transaction-list-item.flex-row.flex-space-between${isClickable ? '.pointer' : ''}`, {
- key: `tx-${transaction.id + i}`,
onClick: (event) => {
if (isPending) {
this.props.showTx(transaction.id)
diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js
index 9348b9fc4..8b9004e69 100644
--- a/ui/app/components/transaction-list.js
+++ b/ui/app/components/transaction-list.js
@@ -16,7 +16,6 @@ function TransactionList () {
TransactionList.prototype.render = function () {
const { txsToRender, network, unconfMsgs, address } = this.props
- const transactions = txsToRender.concat(unconfMsgs)
var shapeShiftTxList
if (network === '1'){
shapeShiftTxList = this.props.shapeShiftTxList
@@ -47,7 +46,7 @@ TransactionList.prototype.render = function () {
paddingBottom: '4px',
},
}, [
- 'Transactions',
+ 'History',
]),
h('.tx-list', {
@@ -61,13 +60,22 @@ TransactionList.prototype.render = function () {
transactions.length
? transactions.map((transaction, i) => {
+ let key
+ switch (transaction.key) {
+ case 'shapeshift':
+ const { depositAddress, time } = transaction
+ key = `shift-tx-${depositAddress}-${time}-${i}`
+ break
+ default:
+ key = `tx-${transaction.id}-${i}`
+ }
return h(TransactionListItem, {
- transaction, i, network,
+ transaction, i, network, key,
showTx: (txId) => {
this.props.viewPendingTx(txId)
},
})
- }).concat(viewMoreButton(accountLink))
+ })
: h('.flex-center', {
style: {
flexDirection: 'column',
@@ -75,21 +83,9 @@ TransactionList.prototype.render = function () {
},
}, [
'No transaction history.',
- viewMoreButton(accountLink),
]),
]),
])
)
}
-function viewMoreButton(url) {
- return url ? h('button', {
- style: {
- margin: '10px',
- },
- onClick: (ev) => {
- ev.preventDefault()
- extension.tabs.create({ url })
- },
- }, 'Show More') : null
-}