-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
44 lines (39 loc) · 1.38 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React from 'react';
import * as Sentry from 'sentry-expo';
import { StyleSheet, Text, View } from 'react-native';
import { createStackNavigator, createBottomTabNavigator } from 'react-navigation-stack';
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { Provider as AuthProvider } from './src/context/AuthContext';
import { Provider as ItemProvider } from './src/context/ItemContext';
import LoadingScreen from './src/screens/LoadingScreen';
import HomeScreen from './src/screens/HomeScreen';
import SigninScreen from './src/screens/SigninScreen';
import SignupScreen from './src/screens/SignupScreen';
import SettingsScreen from './src/screens/SettingsScreen';
import { setNavigator } from './src/navigationRef';
Sentry.init({
dsn: 'https://[email protected]/5232787',
enableInExpoDevelopment: true,
debug: true,
});
const switchNavigator = createSwitchNavigator({
loadingScreen: LoadingScreen,
loginFlow: createStackNavigator({
Signin: SigninScreen,
Signup: SignupScreen,
}),
mainFlow: createStackNavigator({
Home: HomeScreen,
Settings: SettingsScreen,
})
});
const App = createAppContainer(switchNavigator);
export default () => {
return (
<AuthProvider>
<ItemProvider>
<App ref={(navigator) => {setNavigator(navigator)}}/>
</ItemProvider>
</AuthProvider>
)
};