-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
48 lines (43 loc) · 1.66 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
import {StyleSheet, SafeAreaView, ActivityIndicator} from 'react-native';
import SearchBar from "./components/SearchBar";
import ViewSelector from "./components/ViewSelector";
import React from "react";
import Colors from "./constants/Colors";
import { useFonts } from 'expo-font';
import ScreenManager from "./components/ScreenManager";
import {GlobalContextProvider} from "./contexts/GlobalContextProvider";
export default function App() {
// import custom fonts
const [fontsLoaded] = useFonts({
'AbrilFatface': require('./assets/fonts/AbrilFatface.ttf'),
});
/* root website structure is divided into these 3 sections:
- header, which expands into a search interface (searchbar + filters combo)
- middle scrolling section, which by default is in it's explore view, it's the main working area
- footer with section selectors, with these 2 sections: Explore and Saved/Favourite, more sections may be added in the future
*/
// app crashes without the fonts loaded first, we're halting the application until it is loaded
if (!fontsLoaded) {
return <ActivityIndicator size='large' color={Colors.primaryAccent}/>;
}
return (
<SafeAreaView style={styles.viewRoot}>
<GlobalContextProvider>
<SearchBar/>
<ScreenManager/>
<ViewSelector/>
</GlobalContextProvider>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
viewRoot: {
flex: 1,
backgroundColor: Colors.primaryBackground,
alignItems: 'center',
justifyContent: 'center',
},
textContainer: {
color: Colors.primaryElement,
},
});