-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
56 lines (51 loc) · 1.49 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
import React, { useEffect, useState } from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
import { createStackNavigator } from "@react-navigation/stack";
import { NavigationContainer } from "@react-navigation/native";
import TabBar from './components/TabBar';
import { colors } from './data/theme';
import MapPage from './screens/Map';
import NearMe from './screens/NearMe';
import PlayMusic from './screens/PlayMusic';
import Profile from './screens/Profile';
import SamplesInLocation from './screens/SamplesInLocation';
import { getSamples } from './api/Sample';
import { allLocations } from './data/cache/cache';
import { getLocations } from './api/Location';
const Stack = createStackNavigator();
/**
* Returns the whole app with all relevant elements.
* @returns {React.JSX.Element} React component represntign the whole app.
*/
const App = () => {
const [ locations, setLocations ] = useState([]);
useEffect(() => {
getLocations().then((result) => {
setLocations(result);
allLocations.push(result);
})
}, [])
return (
<SafeAreaView style={{backgroundColor:colors.dark.bgColor, flex: 1}}>
<NavigationContainer>
<TabBar/>
</NavigationContainer>
</SafeAreaView>
);
}
export default App;