diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-06-22 04:18:32 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-06-22 04:18:32 +0800 |
commit | a08c3bc01b11fbd0e3a243359befbe9fc909edf4 (patch) | |
tree | b79b7324139945c429ca4b6c74715d8040fdf4e1 /ui/app/accounts | |
parent | f7f8f8b1c50be39db22a7b10c6c6db007fe590aa (diff) | |
download | tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.gz tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.bz2 tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.lz tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.xz tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.zst tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.zip |
Auto linted
Diffstat (limited to 'ui/app/accounts')
-rw-r--r-- | ui/app/accounts/account-panel.js | 11 | ||||
-rw-r--r-- | ui/app/accounts/index.js | 100 |
2 files changed, 54 insertions, 57 deletions
diff --git a/ui/app/accounts/account-panel.js b/ui/app/accounts/account-panel.js index b49f4c098..42d186201 100644 --- a/ui/app/accounts/account-panel.js +++ b/ui/app/accounts/account-panel.js @@ -9,13 +9,12 @@ 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 @@ -35,7 +34,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 +67,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..240abd6d9 100644 --- a/ui/app/accounts/index.js +++ b/ui/app/accounts/index.js @@ -10,8 +10,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 +27,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 +61,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 +121,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 +131,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()) } |