1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-04-23 11:52:59 +02:00

Mobile: Removed now unneeded Welcome screen

This commit is contained in:
Laurent Cozic 2019-06-29 00:24:00 +01:00
parent 2955914ca5
commit 6fea7116b6
3 changed files with 10 additions and 78 deletions

View File

@ -134,7 +134,8 @@ class NotesScreenComponent extends BaseScreenComponent {
Folder.delete(folderId).then(() => { Folder.delete(folderId).then(() => {
this.props.dispatch({ this.props.dispatch({
type: 'NAV_GO', type: 'NAV_GO',
routeName: 'Welcome', routeName: 'Notes',
smartFilterId: 'c3176726992c11e9ac940492261af972',
}); });
}).catch((error) => { }).catch((error) => {
alert(error.message); alert(error.message);

View File

@ -1,64 +0,0 @@
const React = require('react'); const Component = React.Component;
const { View, Text, StyleSheet } = require('react-native');
const { connect } = require('react-redux');
const { ScreenHeader } = require('lib/components/screen-header.js');
const { ActionButton } = require('lib/components/action-button.js');
const { BaseScreenComponent } = require('lib/components/base-screen.js');
const { _ } = require('lib/locale.js');
const { themeStyle } = require('lib/components/global-style.js');
class WelcomeScreenComponent extends BaseScreenComponent {
static navigationOptions(options) {
return { header: null };
}
constructor() {
super();
this.styles_ = {};
}
styles() {
const themeId = this.props.theme;
const theme = themeStyle(themeId);
if (this.styles_[themeId]) return this.styles_[themeId];
this.styles_ = {};
let styles = {
message: {
margin: theme.margin,
fontSize: theme.fontSize,
color: theme.color,
},
};
this.styles_[themeId] = StyleSheet.create(styles);
return this.styles_[themeId];
}
render() {
let message = this.props.folders.length ? _('Click on the (+) button to create a new note or notebook. Click on the side menu to access your existing notebooks.') : _('You currently have no notebook. Create one by clicking on (+) button.');
return (
<View style={this.rootStyle(this.props.theme).root} >
<ScreenHeader title={_('Welcome')}/>
<Text style={this.styles().message}>{message}</Text>
<ActionButton addFolderNoteButtons={true} parentFolderId={this.props.selectedFolderId}/>
</View>
);
}
}
const WelcomeScreen = connect(
(state) => {
return {
folders: state.folders,
theme: state.settings.theme,
selectedFolderId: state.selectedFolderId,
};
}
)(WelcomeScreenComponent)
module.exports = { WelcomeScreen };

View File

@ -37,7 +37,6 @@ const { ConfigScreen } = require('lib/components/screens/config.js');
const { FolderScreen } = require('lib/components/screens/folder.js'); const { FolderScreen } = require('lib/components/screens/folder.js');
const { LogScreen } = require('lib/components/screens/log.js'); const { LogScreen } = require('lib/components/screens/log.js');
const { StatusScreen } = require('lib/components/screens/status.js'); const { StatusScreen } = require('lib/components/screens/status.js');
const { WelcomeScreen } = require('lib/components/screens/welcome.js');
const { SearchScreen } = require('lib/components/screens/search.js'); const { SearchScreen } = require('lib/components/screens/search.js');
const { OneDriveLoginScreen } = require('lib/components/screens/onedrive-login.js'); const { OneDriveLoginScreen } = require('lib/components/screens/onedrive-login.js');
const { EncryptionConfigScreen } = require('lib/components/screens/encryption-config.js'); const { EncryptionConfigScreen } = require('lib/components/screens/encryption-config.js');
@ -167,13 +166,15 @@ function historyCanGoBackTo(route, nextRoute) {
return true; return true;
} }
const DEFAULT_ROUTE = {
type: 'NAV_GO',
routeName: 'Notes',
smartFilterId: 'c3176726992c11e9ac940492261af972',
};
const appDefaultState = Object.assign({}, defaultState, { const appDefaultState = Object.assign({}, defaultState, {
sideMenuOpenPercent: 0, sideMenuOpenPercent: 0,
route: { route: DEFAULT_ROUTE,
type: 'NAV_GO',
routeName: 'Welcome',
params: {},
},
noteSelectionEnabled: false, noteSelectionEnabled: false,
}); });
@ -229,8 +230,6 @@ const appReducer = (state = appDefaultState, action) => {
} }
} }
if (action.routeName == 'Welcome') navHistory = [];
//reg.logger().info('Route: ' + currentRouteName + ' => ' + action.routeName); //reg.logger().info('Route: ' + currentRouteName + ' => ' + action.routeName);
newState = Object.assign({}, state); newState = Object.assign({}, state);
@ -500,10 +499,7 @@ async function initialize(dispatch) {
}); });
if (!folder) { if (!folder) {
dispatch({ dispatch(DEFAULT_ROUTE);
type: 'NAV_GO',
routeName: 'Welcome',
});
} else { } else {
dispatch({ dispatch({
type: 'NAV_GO', type: 'NAV_GO',
@ -692,7 +688,6 @@ class AppComponent extends React.Component {
const sideMenuContent = <SafeAreaView style={{flex:1, backgroundColor: theme.backgroundColor}}><SideMenuContent/></SafeAreaView>; const sideMenuContent = <SafeAreaView style={{flex:1, backgroundColor: theme.backgroundColor}}><SideMenuContent/></SafeAreaView>;
const appNavInit = { const appNavInit = {
Welcome: { screen: WelcomeScreen },
Notes: { screen: NotesScreen }, Notes: { screen: NotesScreen },
Note: { screen: NoteScreen }, Note: { screen: NoteScreen },
Tags: { screen: TagsScreen }, Tags: { screen: TagsScreen },