reza fixed some change

master
Reza_ashrafi 3 years ago
parent f9b9bbfdd5
commit 3884f02bbe
  1. 41
      navigation/index.js
  2. 6
      src/screens/Contact/index.js
  3. 4
      src/screens/Contact/layouts/Box.js
  4. 11
      src/screens/Home/index.js
  5. 1
      src/screens/Profile/index.js

@ -49,7 +49,7 @@ import Colors from "../src/constants/Colors";
import fontSize from "../src/constants/fontSize"; import fontSize from "../src/constants/fontSize";
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const BottomTabNavigator = ({ theme }) => { const BottomTabNavigator = ({ theme, userProducts }) => {
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
const [headerShown, setHeaderShown] = React.useState(true); const [headerShown, setHeaderShown] = React.useState(true);
React.useEffect(() => { React.useEffect(() => {
@ -64,6 +64,10 @@ const BottomTabNavigator = ({ theme }) => {
screenOptions={{ screenOptions={{
tabBarHideOnKeyboard: true, tabBarHideOnKeyboard: true,
headerShown, headerShown,
headerStyle: {
backgroundColor:
theme === "light" ? Colors.theme1.white : Colors.theme1.dark,
},
tabBarIconStyle: { tabBarIconStyle: {
transform: [{ scaleX: -1 }], transform: [{ scaleX: -1 }],
}, },
@ -77,7 +81,7 @@ const BottomTabNavigator = ({ theme }) => {
theme === "light" ? Colors.theme1.white : Colors.theme1.dark, theme === "light" ? Colors.theme1.white : Colors.theme1.dark,
transform: [{ scaleX: -1 }], transform: [{ scaleX: -1 }],
height: 65 + insets.bottom, height: 65 + insets.bottom,
borderWidth : 0 borderWidth: 0,
}, },
tabBarLabelStyle: { tabBarLabelStyle: {
transform: [{ scaleX: -1 }, { translateY: -5 }], transform: [{ scaleX: -1 }, { translateY: -5 }],
@ -123,7 +127,7 @@ const BottomTabNavigator = ({ theme }) => {
width={33.58} width={33.58}
height={33.579} height={33.579}
style={{ style={{
transform: [{scale : 0.7}] transform: [{ scale: 0.7 }],
}} }}
> >
<Path <Path
@ -191,7 +195,7 @@ const BottomTabNavigator = ({ theme }) => {
width={35.135} width={35.135}
height={34.763} height={34.763}
style={{ style={{
transform: [{scale : 0.7}] transform: [{ scale: 0.7 }],
}} }}
> >
<G <G
@ -300,12 +304,22 @@ const BottomTabNavigator = ({ theme }) => {
name="ShoppingCartTab" name="ShoppingCartTab"
children={() => <CARTStackScreen theme={theme} />} children={() => <CARTStackScreen theme={theme} />}
options={{ options={{
// tabBarBadge: count, tabBarBadge: userProducts.filter((product) => product.condition < 2)
// tabBarBadgeStyle: { .length
// color: "white", ? userProducts.filter((product) => product.condition < 2).length
// backgroundColor: Colors.theme1.['light'].green79, : null,
// fontSize: fontSize.sm, tabBarBadgeStyle: {
// }, color: "white",
backgroundColor:
theme === "light" ? Colors.theme1.greenCF : Colors.theme1.greenCF,
fontSize: fontSize.sm,
paddingTop: fontSize.sm / 4,
color: theme === "light" ? Colors.theme1.white : Colors.theme1.dark,
borderWidth: 1,
borderColor:
theme === "light" ? Colors.theme1.greenCF : Colors.theme1.dark,
fontFamily: "bold",
},
title: "سبد خرید", title: "سبد خرید",
tabBarIcon: ({ focused, color }) => tabBarIcon: ({ focused, color }) =>
focused ? ( focused ? (
@ -321,7 +335,7 @@ const BottomTabNavigator = ({ theme }) => {
? Colors.theme1.green79 ? Colors.theme1.green79
: Colors.theme1.greenCF : Colors.theme1.greenCF
} }
stroke={theme === 'light' ? "white" : Colors.theme1.dark} stroke={theme === "light" ? "white" : Colors.theme1.dark}
strokeLinecap="round" strokeLinecap="round"
strokeLinejoin="round" strokeLinejoin="round"
strokeWidth={1.5} strokeWidth={1.5}
@ -489,7 +503,6 @@ const VODStackScreen = ({ theme }) => {
}, },
}} }}
initialRouteName="VOD" initialRouteName="VOD"
> >
<VODStack.Screen name="VOD" component={Videos} /> <VODStack.Screen name="VOD" component={Videos} />
<VODStack.Screen name="Video" component={Video} unmountOnExit={true} /> <VODStack.Screen name="Video" component={Video} unmountOnExit={true} />
@ -587,7 +600,9 @@ const Navigation = ({
<Stack.Screen name="Otp" component={Otp} /> <Stack.Screen name="Otp" component={Otp} />
<Stack.Screen <Stack.Screen
name="Root" name="Root"
children={() => <BottomTabNavigator theme={theme} />} children={() => (
<BottomTabNavigator theme={theme} userProducts={userProducts} />
)}
/> />
<Stack.Screen name="QR" component={QR} /> <Stack.Screen name="QR" component={QR} />
<Stack.Screen name="Orders" component={OrdersFollowUp} /> <Stack.Screen name="Orders" component={OrdersFollowUp} />

@ -6,6 +6,7 @@ import {
SafeAreaView, SafeAreaView,
Platform, Platform,
StatusBar, StatusBar,
Linking
} from "react-native"; } from "react-native";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { faq } from "../../redux/actions"; import { faq } from "../../redux/actions";
@ -47,7 +48,7 @@ function Contact({ theme }) {
}, },
bg: "#D3B70233", bg: "#D3B70233",
borderColor: "#D3B70255", borderColor: "#D3B70255",
onPress : navigation.push("Tickets") onPress : () => navigation.push("Tickets")
}, },
call: { call: {
icon: callIcon, icon: callIcon,
@ -59,7 +60,8 @@ function Contact({ theme }) {
link: null, link: null,
bg: "#69FF5F33", bg: "#69FF5F33",
borderColor: "#69FF5F55", borderColor: "#69FF5F55",
onPress : () => {} onPress : () => Linking.openURL(`tel:02188814637`)
}, },
address: { address: {
icon: addressIcon, icon: addressIcon,

@ -17,6 +17,7 @@ const ios = Platform.OS === "ios";
const { height, width } = Dimensions.get("window"); const { height, width } = Dimensions.get("window");
const Box = ({ info, mobile }) => { const Box = ({ info, mobile }) => {
console.log(info);
return ( return (
<TouchableOpacity <TouchableOpacity
style={[ style={[
@ -31,7 +32,8 @@ const Box = ({ info, mobile }) => {
borderWidth: 1, borderWidth: 1,
}, },
]} ]}
onPress={() => info.onPress()} onPress={() => info?.onPress()}
> >
<Image <Image
source={info.icon} source={info.icon}

@ -33,12 +33,7 @@ const Home = ({ route, blogs, books, userProducts, mobile }) => {
}; };
return ( return (
<SafeAreaView <SafeAreaView style={styles.safeStyle}>
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
flex: 1,
}}
>
<Navbar <Navbar
setBoxPosition={setBoxPosition} setBoxPosition={setBoxPosition}
headerOptions={{ headerOptions={{
@ -71,6 +66,10 @@ const Home = ({ route, blogs, books, userProducts, mobile }) => {
// Later on in your styles.. // Later on in your styles..
const styles = StyleSheet.create({ const styles = StyleSheet.create({
safeStyle: {
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
flex: 1,
},
contentContainerStyle: { contentContainerStyle: {
// paddingBottom: 40, // paddingBottom: 40,
// flex : 1, // flex : 1,

@ -72,6 +72,7 @@ function Profile({ mobile, theme, logout, loading }) {
onPress={() => onPress={() =>
asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", { asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", {
showCancelButton: true, showCancelButton: true,
confirmText : 'آره',
onConfirm: () => { onConfirm: () => {
navigation.navigate("HomeTab", { screen: "Home" }); navigation.navigate("HomeTab", { screen: "Home" });
logout(); logout();

Loading…
Cancel
Save