aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-22 04:56:04 +0800
commit8fde8a8921135112ccfdd13ce6b009755b5f71ed (patch)
treecd4ceb1dcd74a601506f92e5669e3022ca800c0c /ui/app/components
parentab15b4c8259d6f6c5ae9d1e51548d73cfc1c67cb (diff)
downloadtangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.gz
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.tar.zst
tangerine-wallet-browser-8fde8a8921135112ccfdd13ce6b009755b5f71ed.zip
Manually linted
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/account-panel.js5
-rw-r--r--ui/app/components/editable-label.js2
-rw-r--r--ui/app/components/eth-balance.js1
-rw-r--r--ui/app/components/mascot.js1
-rw-r--r--ui/app/components/network.js11
-rw-r--r--ui/app/components/panel.js4
-rw-r--r--ui/app/components/pending-msg.js3
-rw-r--r--ui/app/components/pending-tx.js1
-rw-r--r--ui/app/components/template.js4
-rw-r--r--ui/app/components/transaction-list-item-icon.js2
-rw-r--r--ui/app/components/transaction-list-item.js10
-rw-r--r--ui/app/components/transaction-list.js17
12 files changed, 19 insertions, 42 deletions
diff --git a/ui/app/components/account-panel.js b/ui/app/components/account-panel.js
index 05ac5d67b..112b897d5 100644
--- a/ui/app/components/account-panel.js
+++ b/ui/app/components/account-panel.js
@@ -1,9 +1,7 @@
const inherits = require('util').inherits
-const ethUtil = require('ethereumjs-util')
const Component = require('react').Component
const h = require('react-hyperscript')
const formatBalance = require('../util').formatBalance
-const Identicon = require('./identicon')
const addressSummary = require('../util').addressSummary
const Panel = require('./panel')
@@ -21,9 +19,6 @@ AccountPanel.prototype.render = function () {
var account = state.account || {}
var isFauceting = state.isFauceting
- var identicon = new Identicon(identity.address, 46).toString()
- var identiconSrc = `data:image/png;base64,${identicon}`
-
var panelOpts = {
key: `accountPanel${identity.address}`,
onClick: (event) => {
diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js
index 303c49c44..3d7ca17d4 100644
--- a/ui/app/components/editable-label.js
+++ b/ui/app/components/editable-label.js
@@ -12,7 +12,7 @@ function EditableLabel () {
EditableLabel.prototype.render = function () {
const props = this.props
- let state = this.state
+ const state = this.state
if (state && state.isEditingLabel) {
return h('div.editable-label', [
diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js
index 0423d2ab6..710d4fc8b 100644
--- a/ui/app/components/eth-balance.js
+++ b/ui/app/components/eth-balance.js
@@ -1,7 +1,6 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
-const parseBalance = require('../util').parseBalance
const formatBalance = require('../util').formatBalance
module.exports = EthBalanceComponent
diff --git a/ui/app/components/mascot.js b/ui/app/components/mascot.js
index 3e0ecc14f..ddd51f8ba 100644
--- a/ui/app/components/mascot.js
+++ b/ui/app/components/mascot.js
@@ -2,7 +2,6 @@ const inherits = require('util').inherits
const Component = require('react').Component
const h = require('react-hyperscript')
const metamaskLogo = require('metamask-logo')
-const getCaretCoordinates = require('textarea-caret')
const debounce = require('debounce')
module.exports = Mascot
diff --git a/ui/app/components/network.js b/ui/app/components/network.js
index 5a84e7d58..771be5f32 100644
--- a/ui/app/components/network.js
+++ b/ui/app/components/network.js
@@ -14,9 +14,8 @@ Network.prototype.render = function () {
const state = this.props
const networkNumber = state.network
let iconName, hoverText
- const imagePath = '/images/'
- if (networkNumber == 'loading') {
+ if (networkNumber === 'loading') {
return h('img', {
title: 'Attempting to connect to blockchain.',
onClick: (event) => this.props.onClick(event),
@@ -26,10 +25,10 @@ Network.prototype.render = function () {
},
src: 'images/loading.svg',
})
- } else if (parseInt(networkNumber) == 1) {
+ } else if (parseInt(networkNumber) === 1) {
hoverText = 'Main Ethereum Network'
iconName = 'ethereum-network'
- } else if (parseInt(networkNumber) == 2) {
+ } else if (parseInt(networkNumber) === 2) {
hoverText = 'Morden Test Network'
iconName = 'morden-test-network'
} else {
@@ -45,7 +44,7 @@ Network.prototype.render = function () {
title: hoverText,
onClick: (event) => this.props.onClick(event),
}, [
- function () {
+ (function () {
switch (iconName) {
case 'ethereum-network':
return h('.menu-icon.ether-icon')
@@ -60,7 +59,7 @@ Network.prototype.render = function () {
},
})
}
- }(),
+ })(),
])
)
}
diff --git a/ui/app/components/panel.js b/ui/app/components/panel.js
index 8841247a7..cbdc82982 100644
--- a/ui/app/components/panel.js
+++ b/ui/app/components/panel.js
@@ -1,5 +1,4 @@
const inherits = require('util').inherits
-const ethUtil = require('ethereumjs-util')
const Component = require('react').Component
const h = require('react-hyperscript')
const Identicon = require('./identicon')
@@ -14,9 +13,6 @@ function Panel () {
Panel.prototype.render = function () {
var state = this.props
- var identity = state.identity || {}
- var account = state.account || {}
- var isFauceting = state.isFauceting
var style = {
flex: '1 0 auto',
}
diff --git a/ui/app/components/pending-msg.js b/ui/app/components/pending-msg.js
index 2f1b88493..7f3914d56 100644
--- a/ui/app/components/pending-msg.js
+++ b/ui/app/components/pending-msg.js
@@ -3,10 +3,7 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const AccountPanel = require('./account-panel')
-const addressSummary = require('../util').addressSummary
const readableDate = require('../util').readableDate
-const formatBalance = require('../util').formatBalance
-const dataSize = require('../util').dataSize
module.exports = PendingMsg
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 69b9d2962..1835239e5 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -6,7 +6,6 @@ const AccountPanel = require('./account-panel')
const addressSummary = require('../util').addressSummary
const readableDate = require('../util').readableDate
const formatBalance = require('../util').formatBalance
-const dataSize = require('../util').dataSize
module.exports = PendingTx
diff --git a/ui/app/components/template.js b/ui/app/components/template.js
index a5203aec8..b6ed8eaa0 100644
--- a/ui/app/components/template.js
+++ b/ui/app/components/template.js
@@ -10,9 +10,9 @@ function NewComponent () {
}
NewComponent.prototype.render = function () {
- var state = this.props
+ const props = this.props
return (
- h('span', 'Placeholder component')
+ h('span', props.message)
)
}
diff --git a/ui/app/components/transaction-list-item-icon.js b/ui/app/components/transaction-list-item-icon.js
index beeec5192..c640de551 100644
--- a/ui/app/components/transaction-list-item-icon.js
+++ b/ui/app/components/transaction-list-item-icon.js
@@ -12,7 +12,7 @@ function TransactionIcon () {
}
TransactionIcon.prototype.render = function () {
- const { transaction, txParams, isTx, isMsg } = this.props
+ const { transaction, txParams, isMsg } = this.props
if (transaction.status === 'rejected') {
return h('i.fa.fa-exclamation-triangle.fa-lg.error', {
diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js
index f7b357d61..56f2103f3 100644
--- a/ui/app/components/transaction-list-item.js
+++ b/ui/app/components/transaction-list-item.js
@@ -5,7 +5,6 @@ const inherits = require('util').inherits
const EtherBalance = require('./eth-balance')
const addressSummary = require('../util').addressSummary
const explorerLink = require('../../lib/explorer-link')
-const formatBalance = require('../util').formatBalance
const vreme = new (require('vreme'))
const TransactionIcon = require('./transaction-list-item-icon')
@@ -58,8 +57,8 @@ TransactionListItem.prototype.render = function () {
// large identicon
h('.identicon-wrapper.flex-column.flex-center.select-none', [
- transaction.status === 'unconfirmed' ? h('.red-dot', ' ') :
- h(TransactionIcon, { txParams, transaction, isTx, isMsg }),
+ transaction.status === 'unconfirmed' ? h('.red-dot', ' ')
+ : h(TransactionIcon, { txParams, transaction, isTx, isMsg }),
]),
h('.flex-column', [
@@ -108,11 +107,6 @@ function recipientField (txParams, transaction, isTx, isMsg) {
])
}
-TransactionListItem.prototype.renderMessage = function () {
- const { transaction, i, network } = this.props
- return h('div', 'wowie, thats a message')
-}
-
function formatDate (date) {
return vreme.format(new Date(date), 'March 16 2014 14:30')
}
diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js
index e1b41fb44..a1a5db475 100644
--- a/ui/app/components/transaction-list.js
+++ b/ui/app/components/transaction-list.js
@@ -13,7 +13,7 @@ function TransactionList () {
}
TransactionList.prototype.render = function () {
- const { txsToRender, network, unconfTxs, unconfMsgs } = this.props
+ const { txsToRender, network, unconfMsgs } = this.props
const transactions = txsToRender.concat(unconfMsgs)
.sort((a, b) => b.time - a.time)
@@ -49,8 +49,8 @@ TransactionList.prototype.render = function () {
},
}, (
- transactions.length ?
- transactions.map((transaction, i) => {
+ transactions.length
+ ? transactions.map((transaction, i) => {
return h(TransactionListItem, {
transaction, i, network,
showTx: (txId) => {
@@ -58,12 +58,11 @@ TransactionList.prototype.render = function () {
},
})
})
- :
- [h('.flex-center', {
- style: {
- height: '100%',
- },
- }, 'No transaction history...')]
+ : [h('.flex-center', {
+ style: {
+ height: '100%',
+ },
+ }, 'No transaction history...')]
)),
])
)