-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
44 lines (42 loc) · 1.22 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-native-gesture-handler";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import MyApp from "./src/MyApp";
import { ClerkProvider } from "@clerk/clerk-expo";
import * as SecureStore from "expo-secure-store";
import { NavigationContainer } from "@react-navigation/native";
import { UserInactivityProvider } from "./context/UserInactivity";
import { EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY } from "@env";
// const CLERK_PUBLISHABLE_KEY = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;
// Cache the Clerk JWT
const tokenCache = {
async getToken(key) {
try {
return SecureStore.getItemAsync(key);
} catch (err) {
return null;
}
},
async saveToken(key, value) {
try {
return SecureStore.setItemAsync(key, value);
} catch (err) {
return;
}
},
};
export default function App() {
return (
<ClerkProvider
publishableKey={EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY}
tokenCache={tokenCache}
>
<NavigationContainer>
<UserInactivityProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<MyApp />
</GestureHandlerRootView>
</UserInactivityProvider>
</NavigationContainer>
</ClerkProvider>
);
}