|
|
|
@ -1,8 +1,8 @@ |
|
|
|
|
import React, { useEffect } from "react"; |
|
|
|
|
import * as Linking from 'expo-linking'; |
|
|
|
|
import * as Linking from "expo-linking"; |
|
|
|
|
import Svg, { G, Path } from "react-native-svg"; |
|
|
|
|
import { Appearance, Platform, Dimensions } from "react-native"; |
|
|
|
|
import {Entypo} from '@expo/vector-icons'; |
|
|
|
|
import { Entypo } from "@expo/vector-icons"; |
|
|
|
|
import { NavigationContainer, DefaultTheme } from "@react-navigation/native"; |
|
|
|
|
import { createNativeStackNavigator } from "@react-navigation/native-stack"; |
|
|
|
|
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; |
|
|
|
@ -46,7 +46,7 @@ const ios = Platform.OS === "ios"; |
|
|
|
|
const colorScheme = Appearance.getColorScheme(); |
|
|
|
|
|
|
|
|
|
const Tab = createBottomTabNavigator(); |
|
|
|
|
const BottomTabNavigator = () => { |
|
|
|
|
const BottomTabNavigator = ({}) => { |
|
|
|
|
const [headerShown, setHeaderShown] = React.useState(true); |
|
|
|
|
React.useEffect(() => { |
|
|
|
|
setTimeout(() => { |
|
|
|
@ -62,8 +62,7 @@ const BottomTabNavigator = () => { |
|
|
|
|
contentStyle: { |
|
|
|
|
backgroundColor: "white", |
|
|
|
|
}, |
|
|
|
|
tabBarIconStyle : { |
|
|
|
|
}, |
|
|
|
|
tabBarIconStyle: {}, |
|
|
|
|
tabBarLabelPosition: "below-icon", |
|
|
|
|
tabBarActiveTintColor: Colors.theme1[colorScheme].green79, |
|
|
|
|
tabBarInactiveTintColor: "grey", |
|
|
|
@ -127,60 +126,55 @@ const BottomTabNavigator = () => { |
|
|
|
|
name="ShoppingCartTab" |
|
|
|
|
component={CARTStackScreen} |
|
|
|
|
options={{ |
|
|
|
|
// tabBarBadge: count,
|
|
|
|
|
// tabBarBadgeStyle: {
|
|
|
|
|
// color: "white",
|
|
|
|
|
// backgroundColor: Colors.theme1[colorScheme].green79,
|
|
|
|
|
// fontSize: fontSize.sm,
|
|
|
|
|
// },
|
|
|
|
|
title: "سبد خرید", |
|
|
|
|
tabBarIcon: ({ focused, color }) => |
|
|
|
|
focused ? ( |
|
|
|
|
<Svg |
|
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
|
width={33.323} |
|
|
|
|
height={32.317} |
|
|
|
|
width={31.017} |
|
|
|
|
height={31.017} |
|
|
|
|
> |
|
|
|
|
<Path |
|
|
|
|
d="M20.852 29.624h-8.381c-6.984 0-9.778-2.693-9.778-9.426v-8.079c0-6.733 2.794-9.426 9.778-9.426h8.381c6.984 0 9.778 2.693 9.778 9.426v8.079c-.001 6.733-2.794 9.426-9.778 9.426Z" |
|
|
|
|
<G |
|
|
|
|
fill={Colors.theme1[colorScheme].green79} |
|
|
|
|
/> |
|
|
|
|
<Path |
|
|
|
|
data-name="Vector" |
|
|
|
|
d="M16.002 11.957H8.933M21.063 11.951l.9 1.01 2.684-3.03M16.002 21.383H8.933M21.063 21.377l.9 1.01 2.684-3.03" |
|
|
|
|
fill="none" |
|
|
|
|
stroke="#fff" |
|
|
|
|
stroke={"white"} |
|
|
|
|
strokeLinecap="round" |
|
|
|
|
strokeLinejoin="round" |
|
|
|
|
strokeWidth={1.5} |
|
|
|
|
/> |
|
|
|
|
data-name="vuesax/linear/bag-2" |
|
|
|
|
> |
|
|
|
|
<Path d="M9.693 9.912V8.659a6.168 6.168 0 0 1 5.247-6.036 5.816 5.816 0 0 1 6.384 5.79v1.782" /> |
|
|
|
|
<Path |
|
|
|
|
data-name="Vector" |
|
|
|
|
d="M11.631 28.433h7.754c5.2 0 6.126-2.081 6.4-4.614l.969-7.754c.345-3.154-.555-5.726-6.076-5.726H10.339c-5.519 0-6.423 2.572-6.074 5.725l.969 7.754c.271 2.534 1.202 4.615 6.397 4.615ZM20.027 15.509h.011M10.979 15.509h.011" |
|
|
|
|
/> |
|
|
|
|
</G> |
|
|
|
|
</Svg> |
|
|
|
|
) : ( |
|
|
|
|
<Svg |
|
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
|
width={33.323} |
|
|
|
|
height={32.317} |
|
|
|
|
width={31.017} |
|
|
|
|
height={31.017} |
|
|
|
|
> |
|
|
|
|
<Path |
|
|
|
|
d="M16.002 11.957H8.933" |
|
|
|
|
fill="none" |
|
|
|
|
stroke={Colors.theme1[colorScheme].green79} |
|
|
|
|
strokeLinecap="round" |
|
|
|
|
strokeLinejoin="round" |
|
|
|
|
strokeWidth={1.5} |
|
|
|
|
/> |
|
|
|
|
<Path |
|
|
|
|
data-name="Vector" |
|
|
|
|
d="m21.063 11.951.9 1.01 2.684-3.03M16.002 21.383H8.933M21.063 21.377l.9 1.01 2.684-3.03" |
|
|
|
|
fill="none" |
|
|
|
|
stroke={Colors.theme1[colorScheme].green79} |
|
|
|
|
strokeLinecap="round" |
|
|
|
|
strokeLinejoin="round" |
|
|
|
|
strokeWidth={1.5} |
|
|
|
|
/> |
|
|
|
|
<Path |
|
|
|
|
data-name="Vector" |
|
|
|
|
d="M20.852 29.624h-8.381c-6.984 0-9.778-2.693-9.778-9.426v-8.079c0-6.733 2.794-9.426 9.778-9.426h8.381c6.984 0 9.778 2.693 9.778 9.426v8.079c-.001 6.733-2.794 9.426-9.778 9.426Z" |
|
|
|
|
<G |
|
|
|
|
fill="none" |
|
|
|
|
stroke={Colors.theme1[colorScheme].green79} |
|
|
|
|
strokeLinecap="round" |
|
|
|
|
strokeLinejoin="round" |
|
|
|
|
strokeWidth={1.5} |
|
|
|
|
/> |
|
|
|
|
data-name="vuesax/linear/bag-2" |
|
|
|
|
> |
|
|
|
|
<Path d="M9.693 9.912V8.659a6.168 6.168 0 0 1 5.247-6.036 5.816 5.816 0 0 1 6.384 5.79v1.782" /> |
|
|
|
|
<Path |
|
|
|
|
data-name="Vector" |
|
|
|
|
d="M11.631 28.433h7.754c5.2 0 6.126-2.081 6.4-4.614l.969-7.754c.345-3.154-.555-5.726-6.076-5.726H10.339c-5.519 0-6.423 2.572-6.074 5.725l.969 7.754c.271 2.534 1.202 4.615 6.397 4.615ZM20.027 15.509h.011M10.979 15.509h.011" |
|
|
|
|
/> |
|
|
|
|
</G> |
|
|
|
|
</Svg> |
|
|
|
|
), |
|
|
|
|
}} |
|
|
|
@ -433,14 +427,14 @@ const PROFILEStackScreen = () => { |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const prefix = Linking.createURL('/') |
|
|
|
|
const prefix = Linking.createURL("/"); |
|
|
|
|
|
|
|
|
|
const Stack = createNativeStackNavigator(); |
|
|
|
|
const Navigation = ({ getStatus, isLogin }) => { |
|
|
|
|
const Navigation = ({ getStatus, isLogin, userProducts }) => { |
|
|
|
|
const linking = { |
|
|
|
|
prefixes: [prefix], |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
getStatus(); |
|
|
|
|
}, []); |
|
|
|
@ -453,11 +447,20 @@ const Navigation = ({ getStatus, isLogin }) => { |
|
|
|
|
contentStyle: { backgroundColor: Colors.theme1[colorScheme].white }, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{/* <Stack.Screen name="Splash" component={Splash} /> */} |
|
|
|
|
{/* <Stack.Screen name="Login" component={Login} /> */} |
|
|
|
|
<Stack.Screen name="Splash" component={Splash} /> |
|
|
|
|
<Stack.Screen name="Login" component={Login} /> |
|
|
|
|
<Stack.Screen name="Otp" component={Otp} /> |
|
|
|
|
<Stack.Screen name="QR" component={QR} /> |
|
|
|
|
<Stack.Screen name="Root" component={BottomTabNavigator} /> |
|
|
|
|
<Stack.Screen |
|
|
|
|
name="Root" |
|
|
|
|
component={ |
|
|
|
|
BottomTabNavigator |
|
|
|
|
// count={
|
|
|
|
|
// userProducts.filter((product) => product.condition < 2)
|
|
|
|
|
// .length
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
/> |
|
|
|
|
<Stack.Screen name="Orders" component={OrdersFollowUp} /> |
|
|
|
|
<Stack.Screen name="Order" component={OrderDetails} /> |
|
|
|
|
<Stack.Screen name="Faq" component={Faq} /> |
|
|
|
@ -475,6 +478,7 @@ const Navigation = ({ getStatus, isLogin }) => { |
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => ({ |
|
|
|
|
isLogin: state.user.status, |
|
|
|
|
userProducts: state.userProduct.list, |
|
|
|
|
}); |
|
|
|
|
const mapDispatchToProps = { |
|
|
|
|
getStatus: user.getStatus, |
|
|
|
|