reza fixed some change

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

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

@ -74,7 +74,7 @@ const Navbar = ({
return (
<View
style={[
tw("w-full flex flex-row-reverse justify-between items-center px-0"),
tw("w-full flex flex-row-reverse justify-between items-center px-0"),
{
backgroundColor: headerOptions?.backgroundColor
? headerOptions?.backgroundColor

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

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

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

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

Loading…
Cancel
Save