diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-08-24 08:17:08 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-08-26 05:13:32 +0800 |
commit | 483a7fee0a815812ef43601f64083ed26825d0a4 (patch) | |
tree | 5a39a1dd9cd825dbcadb67688ff1cbcc923f8f10 /ui/app/app.js | |
parent | 3756384da6cb7d1566271cb99ec561d3b051a4ac (diff) | |
download | tangerine-wallet-browser-483a7fee0a815812ef43601f64083ed26825d0a4.tar tangerine-wallet-browser-483a7fee0a815812ef43601f64083ed26825d0a4.tar.gz tangerine-wallet-browser-483a7fee0a815812ef43601f64083ed26825d0a4.tar.bz2 tangerine-wallet-browser-483a7fee0a815812ef43601f64083ed26825d0a4.tar.lz tangerine-wallet-browser-483a7fee0a815812ef43601f64083ed26825d0a4.tar.xz tangerine-wallet-browser-483a7fee0a815812ef43601f64083ed26825d0a4.tar.zst tangerine-wallet-browser-483a7fee0a815812ef43601f64083ed26825d0a4.zip |
Add a back button on lock screen to go back to init menu
Diffstat (limited to 'ui/app/app.js')
-rw-r--r-- | ui/app/app.js | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index 84ff16ec8..b1c258270 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -51,6 +51,7 @@ function mapStateToProps (state) { menuOpen: state.appState.menuOpen, network: state.metamask.network, provider: state.metamask.provider, + forgottenPassword: state.appState.forgottenPassword, } } @@ -89,6 +90,7 @@ App.prototype.render = function () { transitionLeaveTimeout: 300, }, [ this.renderPrimary(), + this.renderBackToInitButton(), ]), ]), ]) @@ -294,6 +296,61 @@ App.prototype.renderDropdown = function () { ]) } +App.prototype.renderBackToInitButton = function () { + var props = this.props + var button = null + var backButton = h('.flex-row', { + key: 'leftArrow', + transForward: false, + style: { + position: 'absolute', + bottom: '10px', + left: '8px', + fontSize: '21px', + fontFamily: 'Montserrat Light', + color: '#7F8082', + width: '71.969px', + alignItems: 'flex-end', + }, + }, [ + h('i.fa.fa-arrow-left.cursor-pointer'), + h('div.cursor-pointer', { + style: { + marginLeft: '3px', + }, + onClick: () => props.dispatch(actions.goBackToInitView()), + }, 'Back'), + ]) + if (!props.isUnlocked) { + if (props.currentView.name === 'InitMenu') { + button = props.forgottenPassword ? h('.flex-row', { + key: 'rightArrow', + style: { + position: 'absolute', + bottom: '10px', + right: '8px', + fontSize: '21px', + fontFamily: 'Montserrat Light', + color: '#7F8082', + width: '77.578px', + alignItems: 'flex-end', + }, + }, [ + h('div.cursor-pointer', { + style: { + marginRight: '3px', + }, + onClick: () => props.dispatch(actions.backToUnlockView()), + }, 'Login'), + h('i.fa.fa-arrow-right.cursor-pointer'), + ]) : null + } else if (props.isInitialized) { + button = backButton + } + } + return button +} + App.prototype.renderPrimary = function () { var props = this.props @@ -306,7 +363,7 @@ App.prototype.renderPrimary = function () { } // show initialize screen - if (!props.isInitialized) { + if (!props.isInitialized || props.forgottenPassword) { // show current view switch (props.currentView.name) { |