-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
60 lines (55 loc) · 1.74 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React from 'react';
import {
createAppContainer,
createStackNavigator,
createBottomTabNavigator,
createSwitchNavigator
} from 'react-navigation';
import AccountScreen from './src/screens/AccountScreen';
import SigninScreen from './src/screens/SigninScreen';
import SignupScreen from './src/screens/SignupScreen';
import TrackCreateScreen from './src/screens/TrackCreateScreen';
import TrackDetailScreen from './src/screens/TrackDetailScreen';
import TrackListScreen from './src/screens/TrackListScreen';
import { Provider as AuthProvider } from './src/context/AuthContext';
import { setNavigator } from './src/navigationRef';
import ResolveAuthScreen from './src/screens/ResolveAuthScreen';
import { Provider as LocationProvider } from './src/context/LocationContext';
import { Provider as TrackProvider } from './src/context/TrackContext';
import { FontAwesome } from '@expo/vector-icons';
const trackListFlow = createStackNavigator({
TrackList: TrackListScreen,
TrackDetail: TrackDetailScreen
});
trackListFlow.navigationOptions = {
title: 'Tracks',
tabBarIcon: <FontAwesome name="th-list" size={20} />
};
const switchNavigator = createSwitchNavigator({
ResolveAuth: ResolveAuthScreen,
loginFlow: createStackNavigator({
Signup: SignupScreen,
Signin: SigninScreen
}),
mainFlow: createBottomTabNavigator({
trackListFlow,
TrackCreate: TrackCreateScreen,
Account: AccountScreen
})
});
const App = createAppContainer(switchNavigator);
export default () => {
return (
<TrackProvider>
<LocationProvider>
<AuthProvider>
<App
ref={navigator => {
setNavigator(navigator);
}}
/>
</AuthProvider>
</LocationProvider>
</TrackProvider>
);
};