diff options
Diffstat (limited to 'ui/app/app.js')
-rw-r--r-- | ui/app/app.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index 938caffd9..dcc44ee65 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -61,6 +61,7 @@ App.prototype.render = function () { style: { // Windows was showing a vertical scroll bar: overflow: 'hidden', + position: 'relative', }, }, [ @@ -177,7 +178,7 @@ App.prototype.renderAppBar = function () { onClick: (event) => { event.preventDefault() event.stopPropagation() - this.props.dispatch(actions.toggleMenu()) + this.setState({ isMainMenuOpen: true }) }, }), ]), @@ -197,7 +198,7 @@ App.prototype.renderNetworkDropdown = function () { this.setState({ isNetworkMenuOpen: !isOpen }) }, style: { - position: 'fixed', + position: 'absolute', left: 0, zIndex: 0, }, @@ -239,14 +240,16 @@ App.prototype.renderNetworkDropdown = function () { } App.prototype.renderDropdown = function () { - const props = this.props + const state = this.state || {} + const isOpen = state.isMainMenuOpen + return h(MenuDroppo, { - isOpen: props.menuOpen, + isOpen: isOpen, onClickOutside: (event) => { - this.props.dispatch(actions.closeMenu()) + this.setState({ isMainMenuOpen: !isOpen }) }, style: { - position: 'fixed', + position: 'absolute', right: 0, zIndex: 0, }, @@ -262,21 +265,21 @@ App.prototype.renderDropdown = function () { h(DropMenuItem, { label: 'Settings', - closeMenu: () => this.props.dispatch(actions.closeMenu()), + closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), action: () => this.props.dispatch(actions.showConfigPage()), icon: h('i.fa.fa-gear.fa-lg', { ariaHidden: true }), }), h(DropMenuItem, { label: 'Lock', - closeMenu: () => this.props.dispatch(actions.closeMenu()), + closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), action: () => this.props.dispatch(actions.lockMetamask()), icon: h('i.fa.fa-lock.fa-lg', { ariaHidden: true }), }), h(DropMenuItem, { label: 'Help', - closeMenu: () => this.props.dispatch(actions.closeMenu()), + closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), action: () => this.props.dispatch(actions.showInfoPage()), icon: h('i.fa.fa-question.fa-lg', { ariaHidden: true }), }), |