-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
64 lines (56 loc) · 2.07 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
61
62
63
64
import React from 'react'
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { createBottomTabNavigator } from 'react-navigation-tabs';
import AccountScreen from './src/screens/AccountScreen'
import SignupScreen from './src/screens/SignupScreen'
import SigninScreen from './src/screens/SigninScreen'
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 } from './src/context/LocationContext';
import { Provider as LocationProvider } from './src/context/LocationContext'
import { Provider as TrackProvider } from './src/context/TrackContext'
import { ActivityIndicator, TabBarIOS } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
const trackListFlow = createStackNavigator({
TrackList: TrackListScreen,
TrackDetail: TrackDetailScreen
})
trackListFlow.navigationOptions = {
title: "Tracks",
tabBarIcon : <MaterialIcons name="track-changes" size={24} color="#fff" />,
tabBarOptions: {
activeTintColor: '#e84a5f',
},
}
const switchNavigator = createSwitchNavigator({
ResolveAuth: ResolveAuthScreen,
loginFlow: createSwitchNavigator({
Signup: SignupScreen,
Signin: SigninScreen
}),
mainFlow: createBottomTabNavigator({
trackListFlow,
TrackCreate: TrackCreateScreen,
Account: AccountScreen
})
})
const App = createAppContainer(switchNavigator);
export default () => {
return (
<SafeAreaProvider>
<TrackProvider>
<LocationProvider>
<AuthProvider>
<App theme="dark" ref={(Navigator) => {setNavigator(Navigator)}}/>
</AuthProvider>
</LocationProvider>
</TrackProvider>
</SafeAreaProvider>
)
}