-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
58 lines (48 loc) · 1.53 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
57
58
import './src/config/firebase';
import * as React from 'react';
import { useFonts } from 'expo-font';
// import { StatusBar } from 'expo-status-bar';
// import { StyleSheet, Text, View } from 'react-native';
import { ThemeProvider } from 'react-native-elements';
import { useAuthentication } from './src/util/hooks/userAuth';
import Main from './src/Main';
import AuthStack from './src/stack/AuthStack';
import UserContext from './src/util/UserContext';
export default function App() {
const { user } = useAuthentication();
const [fontsLoaded] = useFonts({
VT323: require('./assets/fonts/VT323-Regular.ttf'),
PokemonSolid: require('./assets/fonts/Pokemon-Solid.ttf'),
Ketchum: require('./assets/fonts/Ketchum.otf'),
});
const isHermes = () => !!global.HermesInternal;
console.info('Using the Hermes Engine:', isHermes());
// TODO: user should live in a React context
if (fontsLoaded) {
return (
<UserContext.Provider value={user}>
<ThemeProvider>
{user ? <Main user={user} /> : <AuthStack />}
{/* TODO: DO NOT RELEASE THIS INTO PRODUCTION */}
{/* <Main /> */}
</ThemeProvider>
</UserContext.Provider>
);
}
}
// const styles = StyleSheet.create({
// container: {
// flex: 1,
// backgroundColor: '#fff',
// alignItems: 'center',
// justifyContent: 'center',
// },
// });
// {
// /*
// <View style={styles.container}>
// <Text>Open up App.js to start working on your app!</Text>
// <StatusBar style="auto" />
// </View>
// */
// }