-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
44 lines (41 loc) · 1.05 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
import React from "react";
import { StatusBar } from "expo-status-bar";
import HomeScreen from "./components/Screens/HomeScreen";
import AppProvider, { AppContext } from "./context/AppContext";
import { APP_PAGES } from "./context/settings";
import { StyleSheet, View } from "react-native";
import SpecScreen from "./components/Screens/SpecScreen";
function App() {
return (
<AppProvider>
<NavWrapper />
</AppProvider>
);
}
const NavWrapper = () => {
const { navPage, setNavPage } = React.useContext(AppContext);
const onSetNavPage = (e) => {
setNavPage(e);
};
React.useEffect(() => {
console.log("App Nav: ", navPage);
}, [navPage]);
return (
<View style={styles.outline}>
<StatusBar
style="dark"
backgroundColor="#fff"
hidden={false}
translucent={true}
/>
{navPage === APP_PAGES.APP.HOME && <HomeScreen />}
{navPage === APP_PAGES.APP.RESULT_SCREEN && <SpecScreen />}
</View>
);
};
const styles = StyleSheet.create({
outline: {
flex: 1
}
});
export default App;