1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/ReactNativeClient/lib/components/screens/welcome.js

42 lines
951 B
JavaScript
Raw Normal View History

2017-05-24 22:11:37 +02:00
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { connect } from 'react-redux'
2017-06-24 20:06:28 +02:00
import { Log } from 'lib/log.js'
import { ScreenHeader } from 'lib/components/screen-header.js';
2017-07-09 00:57:09 +02:00
import { ActionButton } from 'lib/components/action-button.js';
2017-05-24 22:11:37 +02:00
class WelcomeScreenComponent extends React.Component {
2017-05-24 22:11:37 +02:00
2017-06-06 22:01:43 +02:00
static navigationOptions(options) {
2017-05-24 22:11:37 +02:00
return { header: null };
}
render() {
2017-07-09 00:57:09 +02:00
if (this.props.loading) {
return (
<View style={{flex: 1}}>
<Text>Loading...</Text>
</View>
);
} else {
return (
<View style={{flex: 1}}>
<ScreenHeader navState={this.props.navigation.state} />
<Text>You currently have no notebook. Create one by clicking on (+) button.</Text>
<ActionButton></ActionButton>
</View>
);
}
2017-05-24 22:11:37 +02:00
}
}
const WelcomeScreen = connect(
2017-05-24 22:11:37 +02:00
(state) => {
2017-07-09 00:57:09 +02:00
return {
loading: state.loading,
};
2017-05-24 22:11:37 +02:00
}
)(WelcomeScreenComponent)
2017-05-24 22:11:37 +02:00
export { WelcomeScreen };