mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Mobile: Removed now unneeded Welcome screen
This commit is contained in:
parent
2955914ca5
commit
6fea7116b6
@ -134,7 +134,8 @@ class NotesScreenComponent extends BaseScreenComponent {
|
||||
Folder.delete(folderId).then(() => {
|
||||
this.props.dispatch({
|
||||
type: 'NAV_GO',
|
||||
routeName: 'Welcome',
|
||||
routeName: 'Notes',
|
||||
smartFilterId: 'c3176726992c11e9ac940492261af972',
|
||||
});
|
||||
}).catch((error) => {
|
||||
alert(error.message);
|
||||
|
@ -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 };
|
@ -37,7 +37,6 @@ const { ConfigScreen } = require('lib/components/screens/config.js');
|
||||
const { FolderScreen } = require('lib/components/screens/folder.js');
|
||||
const { LogScreen } = require('lib/components/screens/log.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 { OneDriveLoginScreen } = require('lib/components/screens/onedrive-login.js');
|
||||
const { EncryptionConfigScreen } = require('lib/components/screens/encryption-config.js');
|
||||
@ -167,13 +166,15 @@ function historyCanGoBackTo(route, nextRoute) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const DEFAULT_ROUTE = {
|
||||
type: 'NAV_GO',
|
||||
routeName: 'Notes',
|
||||
smartFilterId: 'c3176726992c11e9ac940492261af972',
|
||||
};
|
||||
|
||||
const appDefaultState = Object.assign({}, defaultState, {
|
||||
sideMenuOpenPercent: 0,
|
||||
route: {
|
||||
type: 'NAV_GO',
|
||||
routeName: 'Welcome',
|
||||
params: {},
|
||||
},
|
||||
route: DEFAULT_ROUTE,
|
||||
noteSelectionEnabled: false,
|
||||
});
|
||||
|
||||
@ -229,8 +230,6 @@ const appReducer = (state = appDefaultState, action) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (action.routeName == 'Welcome') navHistory = [];
|
||||
|
||||
//reg.logger().info('Route: ' + currentRouteName + ' => ' + action.routeName);
|
||||
|
||||
newState = Object.assign({}, state);
|
||||
@ -500,10 +499,7 @@ async function initialize(dispatch) {
|
||||
});
|
||||
|
||||
if (!folder) {
|
||||
dispatch({
|
||||
type: 'NAV_GO',
|
||||
routeName: 'Welcome',
|
||||
});
|
||||
dispatch(DEFAULT_ROUTE);
|
||||
} else {
|
||||
dispatch({
|
||||
type: 'NAV_GO',
|
||||
@ -692,7 +688,6 @@ class AppComponent extends React.Component {
|
||||
const sideMenuContent = <SafeAreaView style={{flex:1, backgroundColor: theme.backgroundColor}}><SideMenuContent/></SafeAreaView>;
|
||||
|
||||
const appNavInit = {
|
||||
Welcome: { screen: WelcomeScreen },
|
||||
Notes: { screen: NotesScreen },
|
||||
Note: { screen: NoteScreen },
|
||||
Tags: { screen: TagsScreen },
|
||||
|
Loading…
Reference in New Issue
Block a user