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

54 lines
1.4 KiB
JavaScript
Raw Normal View History

2017-05-24 20:11:37 +00:00
import React, { Component } from 'react';
2017-07-21 23:42:24 +01:00
import { View, Text, StyleSheet } from 'react-native';
2017-05-24 20:11:37 +00:00
import { connect } from 'react-redux'
2017-06-24 19:06:28 +01:00
import { Log } from 'lib/log.js'
import { ScreenHeader } from 'lib/components/screen-header.js';
2017-07-08 23:57:09 +01:00
import { ActionButton } from 'lib/components/action-button.js';
2017-07-14 18:49:14 +00:00
import { BaseScreenComponent } from 'lib/components/base-screen.js';
2017-07-13 22:50:21 +01:00
import { _ } from 'lib/locale.js';
2017-07-21 23:42:24 +01:00
import { globalStyle } from 'lib/components/global-style.js';
const styles = StyleSheet.create({
message: {
margin: globalStyle.margin,
},
});
2017-05-24 20:11:37 +00:00
2017-07-14 18:49:14 +00:00
class WelcomeScreenComponent extends BaseScreenComponent {
2017-05-24 20:11:37 +00:00
2017-06-06 20:01:43 +00:00
static navigationOptions(options) {
2017-05-24 20:11:37 +00:00
return { header: null };
}
render() {
2017-07-08 23:57:09 +01:00
if (this.props.loading) {
return (
<View style={{flex: 1}}>
<Text>Loading...</Text>
</View>
);
} else {
2017-07-13 22:50:21 +01:00
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.');
2017-07-08 23:57:09 +01:00
return (
2017-07-14 18:49:14 +00:00
<View style={this.styles().screen} >
2017-07-24 22:58:14 +01:00
<ScreenHeader title={_('Welcome')}/>
2017-07-21 23:42:24 +01:00
<Text style={styles.message}>{message}</Text>
2017-07-14 00:35:37 +01:00
<ActionButton addFolderNoteButtons={true}/>
2017-07-08 23:57:09 +01:00
</View>
);
}
2017-05-24 20:11:37 +00:00
}
}
const WelcomeScreen = connect(
2017-05-24 20:11:37 +00:00
(state) => {
2017-07-08 23:57:09 +01:00
return {
loading: state.loading,
2017-07-13 22:50:21 +01:00
folders: state.folders,
2017-07-08 23:57:09 +01:00
};
2017-05-24 20:11:37 +00:00
}
)(WelcomeScreenComponent)
2017-05-24 20:11:37 +00:00
export { WelcomeScreen };