From a08c3bc01b11fbd0e3a243359befbe9fc909edf4 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 21 Jun 2016 13:18:32 -0700 Subject: Auto linted --- ui/app/app.js | 54 ++++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index 6088d17e4..b4a44f15e 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -33,11 +33,10 @@ const NetworkIndicator = require('./components/network') module.exports = connect(mapStateToProps)(App) - inherits(App, Component) -function App() { Component.call(this) } +function App () { Component.call(this) } -function mapStateToProps(state) { +function mapStateToProps (state) { return { // state from plugin isConfirmed: state.metamask.isConfirmed, @@ -54,7 +53,7 @@ function mapStateToProps(state) { } } -App.prototype.render = function() { +App.prototype.render = function () { var props = this.props var view = props.currentView.name var transForward = props.transForward @@ -65,7 +64,7 @@ App.prototype.render = function() { style: { // Windows was showing a vertical scroll bar: overflow: 'hidden', - } + }, }, [ h(LoadingIndicator), @@ -80,7 +79,7 @@ App.prototype.render = function() { style: { height: '380px', width: '360px', - } + }, }, [ h(ReactCSSTransitionGroup, { className: 'css-transition-group', @@ -95,7 +94,7 @@ App.prototype.render = function() { ) } -App.prototype.renderAppBar = function(){ +App.prototype.renderAppBar = function () { const props = this.props const state = this.state || {} const isNetworkMenuOpen = state.isNetworkMenuOpen || false @@ -117,11 +116,11 @@ App.prototype.renderAppBar = function(){ h(NetworkIndicator, { network: this.props.network, - onClick:(event) => { + onClick: (event) => { event.preventDefault() event.stopPropagation() this.setState({ isNetworkMenuOpen: !isNetworkMenuOpen }) - } + }, }), // metamask name @@ -144,7 +143,7 @@ App.prototype.renderAppBar = function(){ ) } -App.prototype.renderNetworkDropdown = function() { +App.prototype.renderNetworkDropdown = function () { const props = this.props const state = this.state || {} const isOpen = state.isNetworkMenuOpen @@ -153,7 +152,7 @@ App.prototype.renderNetworkDropdown = function() { return h(MenuDroppo, { isOpen, - onClickOutside:(event) => { + onClickOutside: (event) => { this.setState({ isNetworkMenuOpen: !isOpen }) }, style: { @@ -173,28 +172,28 @@ App.prototype.renderNetworkDropdown = function() { h(DropMenuItem, { label: 'Main Ethereum Network', - closeMenu:() => this.setState({ isNetworkMenuOpen: false }), - action:() => props.dispatch(actions.setProviderType('mainnet')), + closeMenu: () => this.setState({ isNetworkMenuOpen: false }), + action: () => props.dispatch(actions.setProviderType('mainnet')), icon: h('.menu-icon.ether-icon'), }), h(DropMenuItem, { label: 'Morden Test Network', - closeMenu:() => this.setState({ isNetworkMenuOpen: false }), - action:() => props.dispatch(actions.setProviderType('testnet')), + closeMenu: () => this.setState({ isNetworkMenuOpen: false }), + action: () => props.dispatch(actions.setProviderType('testnet')), icon: h('.menu-icon.morden-icon'), }), h(DropMenuItem, { label: 'Localhost 8545', - closeMenu:() => this.setState({ isNetworkMenuOpen: false }), - action:() => props.dispatch(actions.setRpcTarget('http://localhost:8545')), + closeMenu: () => this.setState({ isNetworkMenuOpen: false }), + action: () => props.dispatch(actions.setRpcTarget('http://localhost:8545')), icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }), }), ]) } -App.prototype.renderDropdown = function() { +App.prototype.renderDropdown = function () { const props = this.props return h(MenuDroppo, { isOpen: props.menuOpen, @@ -218,28 +217,28 @@ App.prototype.renderDropdown = function() { h(DropMenuItem, { label: 'Settings', - closeMenu:() => this.props.dispatch(actions.closeMenu()), - action:() => this.props.dispatch(actions.showConfigPage()), + closeMenu: () => this.props.dispatch(actions.closeMenu()), + action: () => this.props.dispatch(actions.showConfigPage()), icon: h('i.fa.fa-gear.fa-lg', { ariaHidden: true }), }), h(DropMenuItem, { label: 'Lock', - closeMenu:() => this.props.dispatch(actions.closeMenu()), - action:() => this.props.dispatch(actions.lockMetamask()), + closeMenu: () => this.props.dispatch(actions.closeMenu()), + action: () => this.props.dispatch(actions.lockMetamask()), icon: h('i.fa.fa-lock.fa-lg', { ariaHidden: true }), }), h(DropMenuItem, { label: 'Help', - closeMenu:() => this.props.dispatch(actions.closeMenu()), - action:() => this.props.dispatch(actions.showInfoPage()), + closeMenu: () => this.props.dispatch(actions.closeMenu()), + action: () => this.props.dispatch(actions.showInfoPage()), icon: h('i.fa.fa-question.fa-lg', { ariaHidden: true }), }), ]) } -App.prototype.renderPrimary = function(){ +App.prototype.renderPrimary = function () { var props = this.props if (!props.isConfirmed) { @@ -252,7 +251,6 @@ App.prototype.renderPrimary = function(){ // show initialize screen if (!props.isInitialized) { - // show current view switch (props.currentView.name) { @@ -305,10 +303,10 @@ App.prototype.renderPrimary = function(){ default: return h(AccountDetailScreen, {key: 'account-detail'}) - } + } } -App.prototype.toggleMetamaskActive = function(){ +App.prototype.toggleMetamaskActive = function () { if (!this.props.isUnlocked) { // currently inactive: redirect to password box var passwordBox = document.querySelector('input[type=password]') -- cgit v1.2.3 From 8fde8a8921135112ccfdd13ce6b009755b5f71ed Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 21 Jun 2016 13:56:04 -0700 Subject: Manually linted --- ui/app/app.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index b4a44f15e..7204fb098 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -1,10 +1,7 @@ const inherits = require('util').inherits -const React = require('react') const Component = require('react').Component -const PropTypes = require('react').PropTypes const connect = require('react-redux').connect const h = require('react-hyperscript') -const extend = require('xtend') const actions = require('./actions') const ReactCSSTransitionGroup = require('react-addons-css-transition-group') // init @@ -25,7 +22,6 @@ const ConfigScreen = require('./config') const RevealSeedConfirmation = require('./recover-seed/confirmation') const InfoScreen = require('./info') const LoadingIndicator = require('./loading') -const txHelper = require('../lib/tx-helper') const SandwichExpando = require('sandwich-expando') const MenuDroppo = require('menu-droppo') const DropMenuItem = require('./components/drop-menu-item') @@ -55,7 +51,6 @@ function mapStateToProps (state) { App.prototype.render = function () { var props = this.props - var view = props.currentView.name var transForward = props.transForward return ( @@ -148,8 +143,6 @@ App.prototype.renderNetworkDropdown = function () { const state = this.state || {} const isOpen = state.isNetworkMenuOpen - const checked = h('i.fa.fa-check.fa-lg', { ariaHidden: true }) - return h(MenuDroppo, { isOpen, onClickOutside: (event) => { -- cgit v1.2.3