forked from cs-utulsa/Start-TU-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
52 lines (37 loc) · 1.41 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
import React, {useEffect, useState} from 'react';
//Dependencies that interface with SQLite database
import { populate } from './Database/Populate_DB';
import { createStackNavigator} from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import LoginPage from './Screens/LoginScreen';
import MainPage from './Screens/MainScreen';
import * as Location from 'expo-location'
import { JsxEmit } from 'typescript';
import { View } from 'react-native';
const { Navigator, Screen } = createStackNavigator()
export default function App() {
const [location, setLocation] = useState({})
useEffect(() => {
populate();
(async () => {
let { status } = await Location.requestForegroundPermissionsAsync();
if (status == 'granted') {
console.log('Permission to access location was successful');
}else{
console.log('Permission to access location was not successful')
}
const loc = await Location.getCurrentPositionAsync()
console.log(loc)
setLocation(loc)
})();
//downloadDatabase_Expo_To_Machine();
}, []);
return (
<NavigationContainer>
<Navigator initialRouteName = "login">
<Screen name = "login" component = {LoginPage}></Screen>
<Screen name = "main" component = {MainPage} options={{headerShown: false}}></Screen>
</Navigator>
</NavigationContainer>
);
}