-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
78 lines (74 loc) · 2.32 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
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View } from "react-native";
import React, { useRef, useEffect, useCallback } from "react";
import { store } from "./src/store";
import { Provider } from "react-redux";
import { useNavigation, CommonActions } from "@react-navigation/native";
import { createNativeStackNavigator } from "react-native-screens/native-stack";
import { NavigationContainer } from "@react-navigation/native";
import { useFonts } from "expo-font";
import * as SplashScreen from "expo-splash-screen";
import HomeScreen from "./src/Screens/HomeScreen";
import AppNavigator from "./src/navigation/AppNavigator";
import { COLORS, FONTS } from "./assets/constants";
import { Provider as PaperProvider } from "react-native-paper";
import FlashMessage from 'react-native-flash-message';
export type RootParamList = {
HomeStack: undefined;
};
const Stack = createNativeStackNavigator<RootParamList>();
export default function App() {
const [loaded] = useFonts({
"Roboto-Black": require("./assets/fonts/Roboto-Black.ttf"),
"Roboto-Bold": require("./assets/fonts/Roboto-Bold.ttf"),
"Roboto-Regular": require("./assets/fonts/Roboto-Regular.ttf"),
});
if (!loaded) {
return null;
}
return (
<Provider store={store}>
<PaperProvider>
<NavigationContainer>
<Stack.Navigator
initialRouteName={"HomeStack"}
screenOptions={{
headerShown: false,
headerStyle: {
backgroundColor: COLORS.black,
},
gestureEnabled: true,
}}
>
<Stack.Screen
name="appTabs"
component={AppNavigator}
options={{
headerShown: false,
}}
/>
</Stack.Navigator>
</NavigationContainer>
<FlashMessage
position="top"
floating
statusBarHeight={30}
titleStyle={{
...FONTS.h4,
}}
textStyle={{
...FONTS.body4,
}}
/>
</PaperProvider>
</Provider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});