-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.tsx
60 lines (55 loc) · 2.05 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
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import React from "react";
import { Platform, StyleSheet } from "react-native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { Provider } from "react-redux";
import { store } from "./src/app/store";
import { Product } from "./src/app/types";
import { HeaderLeft, HeaderRight } from "./src/components/Header";
import CheckoutScreen from "./src/screens/CheckoutScreen";
import ProductDetailScreen from "./src/screens/ProductDetailScreen";
import ProductsScreen from "./src/screens/ProductsScreen";
export type RootStackParamList = {
Products: undefined;
ProductDetail: { product: Product };
Checkout: undefined;
};
const Stack = createNativeStackNavigator<RootStackParamList>();
const App = () => {
return (
<Provider store={store}>
<GestureHandlerRootView style={StyleSheet.absoluteFill}>
<BottomSheetModalProvider>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerTransparent: true,
headerBlurEffect: "light",
headerStyle: {
backgroundColor:
Platform.OS === "ios" ? "transparent" : "#FFFFFFE6",
},
title: "",
headerRight: HeaderRight,
headerLeft: HeaderLeft,
}}>
<Stack.Screen name="Products" component={ProductsScreen} />
<Stack.Screen
name="ProductDetail"
component={ProductDetailScreen}
/>
<Stack.Screen
options={{ headerRight: () => null }}
name="Checkout"
component={CheckoutScreen}
/>
</Stack.Navigator>
</NavigationContainer>
</BottomSheetModalProvider>
</GestureHandlerRootView>
</Provider>
);
};
export default App;