1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Mobile: Moved config menu item to button on side bar

This commit is contained in:
Laurent Cozic 2019-06-26 00:35:26 +01:00
parent 2c5b0010bf
commit 9957b2798c
2 changed files with 23 additions and 9 deletions

View File

@ -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(<View key={'menuOption_' + key++} style={this.styles().divider}/>);
}
menuOptionComponents.push(
<MenuOption value={() => this.config_press()} key={'menuOption_config'} style={this.styles().contextMenuItem}>
<Text style={this.styles().contextMenuItemText}>{_('Configuration')}</Text>
</MenuOption>);
} else {
menuOptionComponents.push(
<MenuOption value={() => this.deleteButton_press()} key={'menuOption_delete'} style={this.styles().contextMenuItem}>

View File

@ -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 <View style={{ marginTop: 15, marginBottom: 15, flex: -1, borderBottomWidth: 1, borderBottomColor: globalStyle.dividerColor }} key={key}></View>
}
renderConfigButton() {
const buttons = [];
buttons.push({
icon: 'md-settings',
onPress: () => {
this.props.dispatch({ type: 'SIDE_MENU_CLOSE' });
NavService.go('Config');
},
});
return (
<ActionButton
buttons={buttons}
buttonIndex={0}
multiStates={true}
/>
);
}
render() {
let items = [];
@ -237,6 +259,7 @@ class SideMenuContentComponent extends Component {
<ScrollView scrollsToTop={false} style={this.styles().menu}>
{ items }
</ScrollView>
{ this.renderConfigButton() }
</View>
</View>
);