aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorsdtsui <szehungdanieltsui@gmail.com>2017-08-03 14:54:21 +0800
committersdtsui <szehungdanieltsui@gmail.com>2017-08-03 15:01:38 +0800
commit3ed81847d1b6f00e208dbcb973cafcc633c268ad (patch)
tree808676a2c5016626e3400c54b394e71ac6c215f7 /ui/app
parentc7ac20ff659bce3dbde67ad5ee4923eab8f00528 (diff)
downloadtangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar.gz
tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar.zst
tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.zip
Isolate routing logic for isUnlocked, remove stray logs
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/account-and-transaction-details.js1
-rw-r--r--ui/app/add-token.js1
-rw-r--r--ui/app/app.js18
-rw-r--r--ui/app/components/tx-view.js1
-rw-r--r--ui/app/components/wallet-view.js2
-rw-r--r--ui/app/main-container.js47
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 <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', {
- style: {}
- }, [h(AccountAndTransactionDetails, {}, [])])
+ style: contents.style,
+ }, [
+ h(contents.component, {
+ key: contents.key,
+ }, [])
+ ])
}