diff options
Diffstat (limited to 'ui/app/app.js')
-rw-r--r-- | ui/app/app.js | 89 |
1 files changed, 88 insertions, 1 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index 53ab7dd00..6dbfbb86b 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(), ]), ]), ]) @@ -299,6 +301,91 @@ App.prototype.renderDropdown = function () { ]) } +App.prototype.renderBackToInitButton = function () { + var props = this.props + var button = null + var backButton = function (style, justArrow = false) { + return ( + h('.flex-row', { + key: 'leftArrow', + transForward: false, + style: style, + onClick: () => props.dispatch(actions.goBackToInitView()), + }, [ + h('i.fa.fa-arrow-left.cursor-pointer'), + justArrow ? null : 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: '15px', + 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) { + var style + switch (props.currentView.name) { + case 'createVault': + style = { + position: 'absolute', + top: '41px', + left: '80px', + fontSize: '21px', + fontFamily: 'Montserrat Bold', + color: 'rgb(174, 174, 174)', + } + return backButton(style, true) + case 'restoreVault': + style = { + position: 'absolute', + top: '41px', + left: '70px', + fontSize: '21px', + fontFamily: 'Montserrat Bold', + color: 'rgb(174, 174, 174)', + } + return backButton(style, true) + default: + style = { + position: 'absolute', + bottom: '10px', + left: '15px', + fontSize: '21px', + fontFamily: 'Montserrat Light', + color: '#7F8082', + width: '71.969px', + alignItems: 'flex-end', + } + return backButton(style) + } + } + } + return button +} + App.prototype.renderPrimary = function () { var props = this.props @@ -311,7 +398,7 @@ App.prototype.renderPrimary = function () { } // show initialize screen - if (!props.isInitialized) { + if (!props.isInitialized || props.forgottenPassword) { // show current view switch (props.currentView.name) { |