From 3ed81847d1b6f00e208dbcb973cafcc633c268ad Mon Sep 17 00:00:00 2001 From: sdtsui Date: Wed, 2 Aug 2017 23:54:21 -0700 Subject: [PATCH] Isolate routing logic for isUnlocked, remove stray logs --- ui/app/account-and-transaction-details.js | 1 - ui/app/add-token.js | 1 - ui/app/app.js | 18 ++------- ui/app/components/tx-view.js | 1 - ui/app/components/wallet-view.js | 2 - ui/app/main-container.js | 47 ++++++++++++++++++++++- 6 files changed, 49 insertions(+), 21 deletions(-) diff --git a/ui/app/account-and-transaction-details.js b/ui/app/account-and-transaction-details.js index 9386b2314..03f2d9db5 100644 --- a/ui/app/account-and-transaction-details.js +++ b/ui/app/account-and-transaction-details.js @@ -13,7 +13,6 @@ function AccountAndTransactionDetails () { } AccountAndTransactionDetails.prototype.render = function () { - console.log('atdR') return h('div', { style: { display: 'flex', diff --git a/ui/app/add-token.js b/ui/app/add-token.js index 15ef7a852..5c6dea4a0 100644 --- a/ui/app/add-token.js +++ b/ui/app/add-token.js @@ -212,7 +212,6 @@ AddTokenScreen.prototype.attemptToAutoFillTokenParams = async function (address) const [ symbol, decimals ] = results if (symbol && decimals) { - console.log('SETTING SYMBOL AND DECIMALS', { symbol, decimals }) this.setState({ symbol: symbol[0], decimals: decimals[0].toString() }) } } diff --git a/ui/app/app.js b/ui/app/app.js index c8ae28b8c..4a6e7491c 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -458,20 +458,10 @@ App.prototype.renderPrimary = function () { // show unlock screen if (!props.isUnlocked) { - switch (props.currentView.name) { - - case 'restoreVault': - log.debug('rendering restore vault screen') - return h(HDRestoreVaultScreen, {key: 'HDRestoreVaultScreen'}) - - case 'config': - log.debug('rendering config screen from unlock screen.') - return h(ConfigScreen, {key: 'config'}) - - default: - log.debug('rendering locked screen') - return h(UnlockScreen, {key: 'locked'}) - } + return h(MainContainer, { + currentViewName: props.currentView.name, + isUnlocked: props.isUnlocked, + }) } // show current view diff --git a/ui/app/components/tx-view.js b/ui/app/components/tx-view.js index dc86e7ea8..c0e40e9b4 100644 --- a/ui/app/components/tx-view.js +++ b/ui/app/components/tx-view.js @@ -51,7 +51,6 @@ TxView.prototype.render = function () { }, [ h('div.phone-visible.fa.fa-bars', { onClick: () => { - console.log("click received") this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar() } }, [ diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index 8fd555ccb..4d1ac1a49 100644 --- a/ui/app/components/wallet-view.js +++ b/ui/app/components/wallet-view.js @@ -46,7 +46,6 @@ WalletView.prototype.render = function () { h('div.phone-visible.fa.fa-bars', { onClick: () => { - console.log("click received-inwalletview") this.props.hideSidebar() } }, [ @@ -128,7 +127,6 @@ WalletView.prototype.render = function () { }, 'BUY'), h('div.wallet-btn', { onClick: () => { - console.log("SHOW"); this.props.showSendPage(); }, style: { diff --git a/ui/app/main-container.js b/ui/app/main-container.js index b9f4902af..ca7a94c67 100644 --- a/ui/app/main-container.js +++ b/ui/app/main-container.js @@ -5,6 +5,9 @@ const TxView = require('./components/tx-view') const WalletView = require('./components/wallet-view') const SlideoutMenu = require('react-burger-menu').slide const AccountAndTransactionDetails = require('./account-and-transaction-details') +const HDRestoreVaultScreen = require('./keychains/hd/restore-vault') +const ConfigScreen = require('./config') +const UnlockScreen = require('./unlock') module.exports = MainContainer @@ -22,9 +25,49 @@ MainContainer.prototype.render = function () { // - router in separate func // // 4. style all buttons as