diff --git a/app/App.js b/app/App.js
index 2e57661..63f2f42 100644
--- a/app/App.js
+++ b/app/App.js
@@ -1,12 +1,32 @@
import React from 'react'
-import { View, Text, StyleSheet } from 'react-native'
+import { MainNavigator } from './src/screens/MainNavigator'
+import { StyleSheet, View, Text, ActivityIndicator } from 'react-native'
+import { useConnection } from './src/hooks/useConnection'
export default function App () {
- return (
-
- Welcome to the workshop!
-
- )
+ const { connected, connectionError } = useConnection()
+
+ // use splashscreen here, if you like
+ if (!connected) {
+ return (
+
+
+ Connecting to our servers...
+
+ )
+ }
+
+ // use alert or other things here, if you like
+ if (connectionError) {
+ return (
+
+ Error, while connecting to our servers!
+ {connectionError.message}
+
+ )
+ }
+
+ return ()
}
const styles = StyleSheet.create({
@@ -16,4 +36,4 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center'
}
-});
+})
diff --git a/app/babel.config.js b/app/babel.config.js
index 167ecad..fb6b196 100644
--- a/app/babel.config.js
+++ b/app/babel.config.js
@@ -1,7 +1,7 @@
-module.exports = function(api) {
- api.cache(true);
+module.exports = function (api) {
+ api.cache(true)
return {
presets: ['babel-preset-expo'],
- plugins: ["module:react-native-dotenv"]
- };
-};
+ plugins: ['module:react-native-dotenv']
+ }
+}
diff --git a/app/index.js b/app/index.js
index 1d6e981..a8644b1 100644
--- a/app/index.js
+++ b/app/index.js
@@ -1,8 +1,8 @@
-import { registerRootComponent } from 'expo';
+import { registerRootComponent } from 'expo'
-import App from './App';
+import App from './App'
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
-registerRootComponent(App);
+registerRootComponent(App)
diff --git a/app/metro.config.js b/app/metro.config.js
index 9430b0f..4872a8d 100644
--- a/app/metro.config.js
+++ b/app/metro.config.js
@@ -1,4 +1,4 @@
// Learn more https://docs.expo.io/guides/customizing-metro
-const { getDefaultConfig } = require('expo/metro-config');
+const { getDefaultConfig } = require('expo/metro-config')
-module.exports = getDefaultConfig(__dirname);
+module.exports = getDefaultConfig(__dirname)
diff --git a/app/src/components/MyTasks.js b/app/src/components/MyTasks.js
new file mode 100644
index 0000000..f787bd3
--- /dev/null
+++ b/app/src/components/MyTasks.js
@@ -0,0 +1,11 @@
+import React from 'react'
+import { Text } from 'react-native'
+
+/**
+ * Here you can implement the logic to subscribe to your tasks and CRUD them.
+ * See: https://github.com/meteorrn/sample
+ * @param props
+ * @returns {JSX.Element}
+ * @constructor
+ */
+export const MyTasks = () => (My Tasks not yet implemented)
diff --git a/app/src/contexts/AuthContext.js b/app/src/contexts/AuthContext.js
new file mode 100644
index 0000000..dac991d
--- /dev/null
+++ b/app/src/contexts/AuthContext.js
@@ -0,0 +1,11 @@
+import { createContext } from 'react'
+
+/**
+ * Our authentication context provides an API for our components
+ * that allows them to communicate with the servers in a decoupled way.
+ * @method signIn
+ * @method signUp
+ * @method signOut
+ * @type {React.Context