diff options
author | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-03 14:54:21 +0800 |
---|---|---|
committer | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-03 15:01:38 +0800 |
commit | 3ed81847d1b6f00e208dbcb973cafcc633c268ad (patch) | |
tree | 808676a2c5016626e3400c54b394e71ac6c215f7 /ui/app/main-container.js | |
parent | c7ac20ff659bce3dbde67ad5ee4923eab8f00528 (diff) | |
download | tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar.gz tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar.bz2 tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar.lz tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar.xz tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.tar.zst tangerine-wallet-browser-3ed81847d1b6f00e208dbcb973cafcc633c268ad.zip |
Isolate routing logic for isUnlocked, remove stray logs
Diffstat (limited to 'ui/app/main-container.js')
-rw-r--r-- | ui/app/main-container.js | 47 |
1 files changed, 45 insertions, 2 deletions
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, + }, []) + ]) } |