aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-06-22 05:24:28 +0800
committerGitHub <noreply@github.com>2016-06-22 05:24:28 +0800
commit537328b5298a42f9d20862d42b9012babcda373c (patch)
tree9a5728447f5b23a918b4a23c12e91ea1b702e527 /ui/app/accounts
parentbb7788373d9c234313d651d88c72c18a8e4ca0aa (diff)
parentd7c3e8e9f5182576eb4a990d385ff8ce4ebd417c (diff)
downloadtangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.gz
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.zst
tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.zip
Merge pull request #303 from MetaMask/AutoLint
Auto lint
Diffstat (limited to 'ui/app/accounts')
-rw-r--r--ui/app/accounts/account-panel.js13
-rw-r--r--ui/app/accounts/index.js101
2 files changed, 54 insertions, 60 deletions
diff --git a/ui/app/accounts/account-panel.js b/ui/app/accounts/account-panel.js
index b49f4c098..53ccf7d2c 100644
--- a/ui/app/accounts/account-panel.js
+++ b/ui/app/accounts/account-panel.js
@@ -9,18 +9,15 @@ const Identicon = require('../components/identicon')
module.exports = NewComponent
-
inherits(NewComponent, Component)
-function NewComponent() {
+function NewComponent () {
Component.call(this)
}
-NewComponent.prototype.render = function() {
+NewComponent.prototype.render = function () {
const identity = this.props.identity
- var mayBeFauceting = identity.mayBeFauceting
var isSelected = this.props.selectedAddress === identity.address
var account = this.props.accounts[identity.address]
- var isFauceting = mayBeFauceting && account.balance === '0x0'
const selectedClass = isSelected ? '.selected' : ''
return (
@@ -35,7 +32,7 @@ NewComponent.prototype.render = function() {
h('.identicon-wrapper.flex-column.flex-center.select-none', [
this.pendingOrNot(),
h(Identicon, {
- address: identity.address
+ address: identity.address,
}),
]),
@@ -68,14 +65,14 @@ NewComponent.prototype.render = function() {
event.stopPropagation()
event.preventDefault()
copyToClipboard(ethUtil.toChecksumAddress(identity.address))
- }
+ },
}),
]),
])
)
}
-NewComponent.prototype.pendingOrNot = function() {
+NewComponent.prototype.pendingOrNot = function () {
const pending = this.props.pending
if (pending.length === 0) return null
return h('.pending-dot', pending.length)
diff --git a/ui/app/accounts/index.js b/ui/app/accounts/index.js
index 8215a559a..775df400b 100644
--- a/ui/app/accounts/index.js
+++ b/ui/app/accounts/index.js
@@ -2,7 +2,6 @@ const inherits = require('util').inherits
const Component = require('react').Component
const h = require('react-hyperscript')
const connect = require('react-redux').connect
-const extend = require('xtend')
const actions = require('../actions')
const valuesFor = require('../util').valuesFor
const findDOMNode = require('react-dom').findDOMNode
@@ -10,8 +9,7 @@ const AccountPanel = require('./account-panel')
module.exports = connect(mapStateToProps)(AccountsScreen)
-
-function mapStateToProps(state) {
+function mapStateToProps (state) {
const pendingTxs = valuesFor(state.metamask.unconfTxs)
const pendingMsgs = valuesFor(state.metamask.unconfMsgs)
const pending = pendingTxs.concat(pendingMsgs)
@@ -28,12 +26,11 @@ function mapStateToProps(state) {
}
inherits(AccountsScreen, Component)
-function AccountsScreen() {
+function AccountsScreen () {
Component.call(this)
}
-
-AccountsScreen.prototype.render = function() {
+AccountsScreen.prototype.render = function () {
var state = this.props
var identityList = valuesFor(state.identities)
var unconfTxList = valuesFor(state.unconfTxs)
@@ -63,48 +60,48 @@ AccountsScreen.prototype.render = function() {
height: '418px',
overflowY: 'auto',
overflowX: 'hidden',
- }
+ },
},
- [
- identityList.map((identity) => {
- const pending = this.props.pending.filter((txOrMsg) => {
- if ('txParams' in txOrMsg) {
- return txOrMsg.txParams.from === identity.address
- } else if ('msgParams' in txOrMsg) {
- return txOrMsg.msgParams.from === identity.address
- } else {
- return false
- }
- })
-
- return h(AccountPanel, {
- key: `acct-panel-${identity.address}`,
- identity,
- selectedAddress: this.props.selectedAddress,
- accounts: this.props.accounts,
- onShowDetail: this.onShowDetail.bind(this),
- pending,
- })
- }),
-
- h('hr.horizontal-line', {key: 'horizontal-line1'}),
- h('div.footer.hover-white.pointer', {
- key: 'reveal-account-bar',
- onClick:() => {
- actions.revealAccount()
- },
- style: {
- display: 'flex',
- flex: '1 0 auto',
- height: '40px',
- paddint: '10px',
- justifyContent: 'center',
- alignItems: 'center',
- }
- }, [
- h('i.fa.fa-plus.fa-lg', {key: ''}),
+ [
+ identityList.map((identity) => {
+ const pending = this.props.pending.filter((txOrMsg) => {
+ if ('txParams' in txOrMsg) {
+ return txOrMsg.txParams.from === identity.address
+ } else if ('msgParams' in txOrMsg) {
+ return txOrMsg.msgParams.from === identity.address
+ } else {
+ return false
+ }
+ })
+
+ return h(AccountPanel, {
+ key: `acct-panel-${identity.address}`,
+ identity,
+ selectedAddress: this.props.selectedAddress,
+ accounts: this.props.accounts,
+ onShowDetail: this.onShowDetail.bind(this),
+ pending,
+ })
+ }),
+
+ h('hr.horizontal-line', {key: 'horizontal-line1'}),
+ h('div.footer.hover-white.pointer', {
+ key: 'reveal-account-bar',
+ onClick: () => {
+ actions.revealAccount()
+ },
+ style: {
+ display: 'flex',
+ flex: '1 0 auto',
+ height: '40px',
+ paddint: '10px',
+ justifyContent: 'center',
+ alignItems: 'center',
+ },
+ }, [
+ h('i.fa.fa-plus.fa-lg', {key: ''}),
+ ]),
]),
- ]),
unconfTxList.length ? (
@@ -123,7 +120,7 @@ AccountsScreen.prototype.render = function() {
}
// If a new account was revealed, scroll to the bottom
-AccountsScreen.prototype.componentDidUpdate = function(){
+AccountsScreen.prototype.componentDidUpdate = function () {
const scrollToBottom = this.props.scrollToBottom
if (scrollToBottom) {
@@ -133,27 +130,27 @@ AccountsScreen.prototype.componentDidUpdate = function(){
}
}
-AccountsScreen.prototype.navigateToConfTx = function(){
+AccountsScreen.prototype.navigateToConfTx = function () {
event.stopPropagation()
this.props.dispatch(actions.showConfTxPage())
}
-AccountsScreen.prototype.onSelect = function(address, event){
+AccountsScreen.prototype.onSelect = function (address, event) {
event.stopPropagation()
// if already selected, deselect
if (this.props.selectedAddress === address) address = null
this.props.dispatch(actions.setSelectedAddress(address))
}
-AccountsScreen.prototype.onShowDetail = function(address, event){
+AccountsScreen.prototype.onShowDetail = function (address, event) {
event.stopPropagation()
this.props.dispatch(actions.showAccountDetail(address))
}
-AccountsScreen.prototype.onRevealAccount = function() {
+AccountsScreen.prototype.onRevealAccount = function () {
this.props.dispatch(actions.revealAccount())
}
-AccountsScreen.prototype.goHome = function() {
+AccountsScreen.prototype.goHome = function () {
this.props.dispatch(actions.goHome())
}