Repository navigation
Expand file tree
/
Copy pathApp.js
More file actions
48 lines (44 loc) · 1.7 KB
/
Copy pathApp.js
File metadata and controls
48 lines (44 loc) · 1.7 KB
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 { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { useFonts } from 'expo-font';
import Login from './App/Pages/Login';
import { ClerkProvider, SignedIn, SignedOut } from '@clerk/clerk-expo';
import { NavigationContainer } from '@react-navigation/native';
import TabNavigation from './App/Navigations/TabNavigation';
import { CompletedChapterContext } from './App/Context/CompletedChapterContext';
import { useState } from 'react';
import { UserPointsContext } from './App/Context/UserPointsContext';
export default function App() {
const [isChapterComplete, setIsChapterComplete] = useState(false);
const [userPoints, setUserPoints] = useState(0);
const [fontsLoaded] = useFonts({
'outfit': require('./assets/fonts/Outfit-Regular.ttf'),
'outfit-bold': require('./assets/fonts/Outfit-Bold.ttf'),
'outfit-medium': require('./assets/fonts/Outfit-SemiBold.ttf'),
});
return (
<ClerkProvider publishableKey={"pk_test_aW1wcm92ZWQtbG91c2UtODQuY2xlcmsuYWNjb3VudHMuZGV2JA"}>
<UserPointsContext.Provider value={{ userPoints, setUserPoints }}>
<CompletedChapterContext.Provider value={{ isChapterComplete, setIsChapterComplete }}>
<View style={styles.container}>
<SignedIn>
<NavigationContainer>
<TabNavigation />
</NavigationContainer>
</SignedIn>
<SignedOut>
<Login />
</SignedOut>
</View>
</CompletedChapterContext.Provider>
</UserPointsContext.Provider>
</ClerkProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
marginTop: 20
},
});