mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Isolate routing logic for isUnlocked, remove stray logs
This commit is contained in:
parent
c7ac20ff65
commit
3ed81847d1
@ -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 = {
|
||||||
return h('div.main-container', {
|
component: AccountAndTransactionDetails,
|
||||||
style: {}
|
key: 'account-detail',
|
||||||
}, [h(AccountAndTransactionDetails, {}, [])])
|
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', {
|
||||||
|
style: contents.style,
|
||||||
|
}, [
|
||||||
|
h(contents.component, {
|
||||||
|
key: contents.key,
|
||||||
|
}, [])
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user