From 9957b2798c80041a7ec3c5a1ad07dd130694b4ca Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Wed, 26 Jun 2019 00:35:26 +0100 Subject: [PATCH] Mobile: Moved config menu item to button on side bar --- .../lib/components/screen-header.js | 9 -------- .../lib/components/side-menu-content.js | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ReactNativeClient/lib/components/screen-header.js b/ReactNativeClient/lib/components/screen-header.js index bc21dc2a5..e32849c41 100644 --- a/ReactNativeClient/lib/components/screen-header.js +++ b/ReactNativeClient/lib/components/screen-header.js @@ -190,10 +190,6 @@ class ScreenHeaderComponent extends Component { NavService.go('Status'); } - config_press() { - NavService.go('Config'); - } - warningBox_press() { NavService.go('EncryptionConfig'); } @@ -284,11 +280,6 @@ class ScreenHeaderComponent extends Component { if (menuOptionComponents.length) { menuOptionComponents.push(); } - - menuOptionComponents.push( - this.config_press()} key={'menuOption_config'} style={this.styles().contextMenuItem}> - {_('Configuration')} - ); } else { menuOptionComponents.push( this.deleteButton_press()} key={'menuOption_delete'} style={this.styles().contextMenuItem}> diff --git a/ReactNativeClient/lib/components/side-menu-content.js b/ReactNativeClient/lib/components/side-menu-content.js index 85b8a9692..b773210a5 100644 --- a/ReactNativeClient/lib/components/side-menu-content.js +++ b/ReactNativeClient/lib/components/side-menu-content.js @@ -8,10 +8,12 @@ const Folder = require('lib/models/Folder.js'); const Setting = require('lib/models/Setting.js'); const { FoldersScreenUtils } = require('lib/folders-screen-utils.js'); const { Synchronizer } = require('lib/synchronizer.js'); +const NavService = require('lib/services/NavService.js'); const { reg } = require('lib/registry.js'); const { _ } = require('lib/locale.js'); const { globalStyle, themeStyle } = require('lib/components/global-style.js'); const shared = require('lib/components/shared/side-menu-shared.js'); +const { ActionButton } = require('lib/components/action-button.js'); class SideMenuContentComponent extends Component { @@ -176,6 +178,26 @@ class SideMenuContentComponent extends Component { return } + renderConfigButton() { + const buttons = []; + + buttons.push({ + icon: 'md-settings', + onPress: () => { + this.props.dispatch({ type: 'SIDE_MENU_CLOSE' }); + NavService.go('Config'); + }, + }); + + return ( + + ); + } + render() { let items = []; @@ -237,6 +259,7 @@ class SideMenuContentComponent extends Component { { items } + { this.renderConfigButton() } );