-
Notifications
You must be signed in to change notification settings - Fork 4
/
App.tsx
67 lines (61 loc) · 1.6 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
import BottomNavBar from '@app/navigation/BottomNavBar';
import {CartScreen, ProductDetailsScreen} from '@app/screens';
import {AppScreensParamsList} from '@app/types';
import {AppColors} from '@app/utils';
import {
ManropeBold,
ManropeMedium,
ManropeRegular,
ManropeSemiBold,
} from '@assets/fonts';
import {NavigationContainer} from '@react-navigation/native';
import {
NativeStackNavigationOptions,
createNativeStackNavigator,
} from '@react-navigation/native-stack';
import {useFonts} from 'expo-font';
import React from 'react';
import Toast from 'react-native-toast-message';
function App(): JSX.Element | null {
const Stack = createNativeStackNavigator<AppScreensParamsList>();
const [fontsLoaded] = useFonts({
ManropeRegular,
ManropeMedium,
ManropeSemiBold,
ManropeBold,
});
if (!fontsLoaded) {
return null;
}
const screensOptions: NativeStackNavigationOptions = {
headerShown: false,
orientation: 'portrait',
contentStyle: {
backgroundColor: AppColors.PureWhite,
},
animation: 'slide_from_right',
};
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="BottomNavBar"
component={BottomNavBar}
options={screensOptions}
/>
<Stack.Screen
name="ProductDetails"
component={ProductDetailsScreen}
options={screensOptions}
/>
<Stack.Screen
name="Cart"
component={CartScreen}
options={screensOptions}
/>
</Stack.Navigator>
<Toast />
</NavigationContainer>
);
}
export default App;