-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.tsx
57 lines (51 loc) · 1.86 KB
/
App.tsx
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
// Import Packages
import React, { Component } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator, StackScreenProps } from '@react-navigation/stack';
import Animated from 'react-native-reanimated';
import * as Location from 'expo-location'
// Import Individual pages as Objects
import MapScreen from './screens/Map';
import GhostPickerScreen from './screens/Ghost_Picker';
import LoginScreen from './screens/Login';
import ProfileScreen from './screens/Profile';
import Friends from './screens/Friends';
import RaceLength from './screens/Race_Length';
import { Alert } from 'react-native';
// import LandingScreen from './screens/Landing_Page';
// Stack Navigation Control
const RootStack = createStackNavigator();
// App Navigation Control
export default class App extends Component {
//
constructor(props) {
global.race_on = false;
super(props);
this.state = {
sliding_animation: new Animated.Value(0),
}
this.enableLocation();
}
async enableLocation() {
let { status } = await Location.requestPermissionsAsync()
if (status !== 'granted'){
Alert.alert('Please Allow Location')
}
}
//s
render() {
return (
<NavigationContainer>
<RootStack.Navigator>
{/* <RootStack.Screen name = "Landing" component = {LandingScreen} /> */}
<RootStack.Screen name = "Map" component = {MapScreen} />
<RootStack.Screen name = "Ghost" component = {GhostPickerScreen} />
<RootStack.Screen name = "Login" component = {LoginScreen} />
<RootStack.Screen name = "Profile" component = {ProfileScreen} />
<RootStack.Screen name = "Friends" component = {Friends} />
<RootStack.Screen name = "RaceLength" component = {RaceLength} />
</RootStack.Navigator>
</NavigationContainer>
);
};
}