Isolate routing logic for isUnlocked, remove stray logs

feature/default_network_editable
sdtsui 7 years ago
parent c7ac20ff65
commit 3ed81847d1
  1. 1
      ui/app/account-and-transaction-details.js
  2. 1
      ui/app/add-token.js
  3. 18
      ui/app/app.js
  4. 1
      ui/app/components/tx-view.js
  5. 2
      ui/app/components/wallet-view.js
  6. 47
      ui/app/main-container.js

@ -13,7 +13,6 @@ function AccountAndTransactionDetails () {
} }
AccountAndTransactionDetails.prototype.render = function () { AccountAndTransactionDetails.prototype.render = function () {
console.log('atdR')
return h('div', { return h('div', {
style: { style: {
display: 'flex', display: 'flex',

@ -212,7 +212,6 @@ AddTokenScreen.prototype.attemptToAutoFillTokenParams = async function (address)
const [ symbol, decimals ] = results const [ symbol, decimals ] = results
if (symbol && decimals) { if (symbol && decimals) {
console.log('SETTING SYMBOL AND DECIMALS', { symbol, decimals })
this.setState({ symbol: symbol[0], decimals: decimals[0].toString() }) this.setState({ symbol: symbol[0], decimals: decimals[0].toString() })
} }
} }

@ -458,20 +458,10 @@ App.prototype.renderPrimary = function () {
// show unlock screen // show unlock screen
if (!props.isUnlocked) { if (!props.isUnlocked) {
switch (props.currentView.name) { return h(MainContainer, {
currentViewName: props.currentView.name,
case 'restoreVault': isUnlocked: props.isUnlocked,
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'})
}
} }
// show current view // show current view

@ -51,7 +51,6 @@ TxView.prototype.render = function () {
}, [ }, [
h('div.phone-visible.fa.fa-bars', { h('div.phone-visible.fa.fa-bars', {
onClick: () => { onClick: () => {
console.log("click received")
this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar() this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar()
} }
}, [ }, [

@ -46,7 +46,6 @@ WalletView.prototype.render = function () {
h('div.phone-visible.fa.fa-bars', { h('div.phone-visible.fa.fa-bars', {
onClick: () => { onClick: () => {
console.log("click received-inwalletview")
this.props.hideSidebar() this.props.hideSidebar()
} }
}, [ }, [
@ -128,7 +127,6 @@ WalletView.prototype.render = function () {
}, 'BUY'), }, 'BUY'),
h('div.wallet-btn', { h('div.wallet-btn', {
onClick: () => { onClick: () => {
console.log("SHOW");
this.props.showSendPage(); this.props.showSendPage();
}, },
style: { style: {

@ -5,6 +5,9 @@ const TxView = require('./components/tx-view')
const WalletView = require('./components/wallet-view') const WalletView = require('./components/wallet-view')
const SlideoutMenu = require('react-burger-menu').slide const SlideoutMenu = require('react-burger-menu').slide
const AccountAndTransactionDetails = require('./account-and-transaction-details') 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 module.exports = MainContainer
@ -22,9 +25,49 @@ MainContainer.prototype.render = function () {
// - router in separate func // - router in separate func
// //
// 4. style all buttons as <button>s: accessibility + mobile focus // 4. style all buttons as <button>s: accessibility + mobile focus
let contents = {
component: AccountAndTransactionDetails,
key: 'account-detail',
style: {},
}
if (this.props.isUnlocked === false) {
switch (this.props.currentViewName) {
case 'restoreVault':
log.debug('rendering restore vault screen')
contents = {
component: HDRestoreVaultScreen,
key: 'HDRestoreVaultScreen',
}
case 'config':
log.debug('rendering config screen from unlock screen.')
contents = {
component: ConfigScreen,
key: 'config',
}
default:
log.debug('rendering locked screen')
contents = {
component: UnlockScreen,
style: {
boxShadow: 'none',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
// must force 100%, because lock screen is full-width
width: '100%',
},
key: 'locked',
}
}
}
return h('div.main-container', { return h('div.main-container', {
style: {} style: contents.style,
}, [h(AccountAndTransactionDetails, {}, [])]) }, [
h(contents.component, {
key: contents.key,
}, [])
])
} }

Loading…
Cancel
Save