Fix lint errors

This commit is contained in:
Alexander Tseung 2017-12-04 03:06:09 -05:00
parent dde39e82b5
commit ec5e0a711c
4 changed files with 44 additions and 14 deletions

View File

@ -1,6 +1,7 @@
const { Component } = require('react')
const PropTypes = require('prop-types')
const { connect } = require('react-redux')
const { Switch, Route, Redirect, withRouter } = require('react-router-dom')
const { Switch, Redirect, withRouter } = require('react-router-dom')
const { compose } = require('recompose')
const h = require('react-hyperscript')
const actions = require('./actions')
@ -16,8 +17,6 @@ const NewKeyChainScreen = require('./new-keychain')
const MainContainer = require('./main-container')
const SendTransactionScreen2 = require('./components/send/send-v2-container')
const ConfirmTxScreen = require('./conf-tx')
// notice
const generateLostAccountsNotice = require('../lib/lost-accounts-notice')
// slideout menu
const WalletView = require('./components/wallet-view')
@ -112,9 +111,15 @@ class App extends Component {
}
render () {
var props = this.props
const { isLoading, loadingMessage, network } = props
const isLoadingNetwork = network === 'loading' && props.currentView.name !== 'config'
const {
isLoading,
loadingMessage,
network,
provider,
frequentRpcList,
currentView,
} = this.props
const isLoadingNetwork = network === 'loading' && currentView.name !== 'config'
const loadMessage = loadingMessage || isLoadingNetwork ?
`Connecting to ${this.getNetworkName()}` : null
log.debug('Main ui render function')
@ -139,8 +144,8 @@ class App extends Component {
// network dropdown
h(NetworkDropdown, {
provider: this.props.provider,
frequentRpcList: this.props.frequentRpcList,
provider,
frequentRpcList,
}, []),
h(AccountMenu),
@ -153,7 +158,6 @@ class App extends Component {
// content
this.renderRoutes(),
// this.renderPrimary(),
])
)
}
@ -337,8 +341,6 @@ class App extends Component {
renderPrimary () {
log.debug('rendering primary')
const {
isMascara,
isOnboarding,
noActiveNotices,
lostAccounts,
isInitialized,
@ -558,6 +560,36 @@ class App extends Component {
}
}
App.propTypes = {
currentCurrency: PropTypes.string,
setCurrentCurrencyToUSD: PropTypes.func,
isLoading: PropTypes.bool,
loadingMessage: PropTypes.string,
network: PropTypes.string,
provider: PropTypes.object,
frequentRpcList: PropTypes.array,
currentView: PropTypes.object,
sidebarOpen: PropTypes.bool,
hideSidebar: PropTypes.func,
isMascara: PropTypes.bool,
isOnboarding: PropTypes.bool,
isUnlocked: PropTypes.bool,
networkDropdownOpen: PropTypes.bool,
showNetworkDropdown: PropTypes.func,
hideNetworkDropdown: PropTypes.func,
history: PropTypes.object,
dispatch: PropTypes.func,
toggleAccountMenu: PropTypes.func,
selectedAddress: PropTypes.string,
noActiveNotices: PropTypes.bool,
lostAccounts: PropTypes.array,
isInitialized: PropTypes.bool,
forgottenPassword: PropTypes.bool,
activeAddress: PropTypes.string,
unapprovedTxs: PropTypes.object,
seedWords: PropTypes.string,
}
function mapStateToProps (state) {
const { appState, metamask } = state
const {

View File

@ -94,7 +94,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
transactionHash,
transactionNetworkId,
} = props
const { showConfTxPage, history } = this.props
const { history } = this.props
const opts = {
key: transActionId || transactionHash,

View File

@ -94,7 +94,6 @@ WalletView.prototype.render = function () {
keyrings,
showAccountDetailModal,
hideSidebar,
showAddTokenPage,
history,
} = this.props
// temporary logs + fake extra wallets

View File

@ -2,7 +2,6 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const AccountAndTransactionDetails = require('./account-and-transaction-details')
const UnlockScreen = require('./components/pages/unauthenticated/unlock')
module.exports = MainContainer