-
Notifications
You must be signed in to change notification settings - Fork 4
/
App.tsx
82 lines (75 loc) · 3.13 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from 'react';
import type { PropsWithChildren } from 'react';
import { Login } from './src/screens/Login/Login';
import { CategoryProducts } from './src/screens/Category_products/CategoryProducts';
import { Home } from './src/screens/Home/Home';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Provider } from "react-redux";
import { store } from './src/redux/store';
import { useSelector } from "react-redux";
import { Button, Image, Text, View } from 'react-native';
import {
MagnifyingGlassIcon
} from 'react-native-heroicons/outline';
import { Checkout } from './src/screens/Checkout/Checkout';
import { AddAddress } from './src/screens/Address/AddAddress';
import { DeliveryScreen } from './src/screens/Delivery/DeliveryScreen';
import { Profile } from './src/screens/Profile/Profile';
import { YourOrders } from './src/screens/YourOrders/YourOrders';
import { Search } from './src/screens/Search/Search';
import { Wishlist } from './src/screens/Wishlist/Wishlist';
import { StripeProvider } from '@stripe/stripe-react-native';
import { pubKey } from './src/constants/environment';
// import { PersistGate } from 'redux-persist/integration/react';
const Stack = createNativeStackNavigator();
function App(): JSX.Element {
// const { currentUser } = useSelector((state: any) => state.user);
return (
<Provider store={store}>
<StripeProvider publishableKey={pubKey} >
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="Category" component={CategoryProducts} options={({ route, navigation }) => ({
title: route?.params?.category, headerTitleStyle: {
fontSize: 20
},
headerRight: () => (
<MagnifyingGlassIcon color="black" size="30" onPress={() => {
navigation.navigate('Search');
}} />
)
})}
/>
<Stack.Screen name="Checkout" component={Checkout} options={({ route }) => ({
headerRight: () => (
<View>
<Text style={{
color: "green",
fontWeight: "bold",
fontSize: 15
}} >Share</Text>
</View>
)
})} />
<Stack.Screen name="Add Address" component={AddAddress} />
<Stack.Screen name="Delivery" component={DeliveryScreen} options={{ headerShown: false }}
/>
<Stack.Screen name="Profile" component={Profile} />
<Stack.Screen name="Your Orders" component={YourOrders} />
<Stack.Screen name="Wishlist" component={Wishlist} />
<Stack.Screen name="Search" component={Search} options={{ headerShown: false }} />
</Stack.Navigator>
</NavigationContainer>
</StripeProvider>
</Provider>
);
}
export default App;