-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.tsx
82 lines (72 loc) · 2.44 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import "react-native-gesture-handler";
import React from "react";
import { Provider } from "react-redux";
import store from "./redux/store";
import { persistStore } from "redux-persist";
import { PersistGate } from "redux-persist/integration/react";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import AppLoading from "expo-app-loading";
import { useFonts, OpenSans_400Regular } from "@expo-google-fonts/open-sans";
import { Rubik_700Bold } from "@expo-google-fonts/rubik";
import { Header } from "./components/";
import {
LandingPage,
IntroPage,
LoginPage,
ActivityGoalPage,
ActivitySourcePage,
StakingPage,
ConfirmationPage,
TrackPage,
CompletionPage,
FaqPage,
} from "./pages";
let persistor = persistStore(store);
const App = () => {
let [fontsLoaded] = useFonts({
OpenSans_400Regular,
Rubik_700Bold,
});
//TODO Do we ever get to the loading screen?
//TODO Refactor/aggregate screen loading away from app.tsx
if (!fontsLoaded) {
return <AppLoading />;
} else {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<NavigationContainer>
<Stack.Navigator
initialRouteName="Landing"
screenOptions={{
headerTitle: () => <Header />,
headerLeft: () => null,
}}
>
<Stack.Screen
name="Landing"
component={LandingPage}
options={{ headerShown: false }}
/>
<Stack.Screen name="Login" component={LoginPage} />
<Stack.Screen name="Intro" component={IntroPage} />
<Stack.Screen name="ActivityGoal" component={ActivityGoalPage} />
<Stack.Screen
name="ActivitySource"
component={ActivitySourcePage}
/>
<Stack.Screen name="Staking" component={StakingPage} />
<Stack.Screen name="Confirmation" component={ConfirmationPage} />
<Stack.Screen name="Track" component={TrackPage} />
<Stack.Screen name="Completion" component={CompletionPage} />
<Stack.Screen name="Faq" component={FaqPage} />
</Stack.Navigator>
</NavigationContainer>
</PersistGate>
</Provider>
);
}
};
const Stack = createStackNavigator();
export default App;