reza fixed some issue

master
Reza_ashrafi 3 years ago
parent 5ff1acee71
commit 23f9797a0b
  1. 5
      navigation/index.js
  2. 141
      src/components/BottomSheetComponents/ProductQuestion.js
  3. 123
      src/components/BottomSheetComponents/ProductReview.js
  4. 122
      src/components/BottomSheetComponents/ProductSpecifications.js
  5. 57
      src/components/Drawer.js
  6. 4
      src/redux/reducers/comment.js
  7. 1
      src/redux/reducers/faq.js
  8. 4
      src/redux/reducers/userFactor.js
  9. 4
      src/redux/reducers/userProduct.js
  10. 4
      src/redux/reducers/vote.js
  11. 34
      src/screens/Product/components/Book.js
  12. 6
      src/screens/Product/components/Comments.js
  13. 344
      src/screens/Product/components/Info.js
  14. 43
      src/screens/Product/components/LinkBox.js
  15. 7
      src/utils/onInput.js

@ -37,6 +37,7 @@ import ProfileAddress from "../src/screens/Profile/components/ProfileAddress";
import Blogs from "../src/screens/Blogs"; import Blogs from "../src/screens/Blogs";
import Blog from "../src/screens/Blog"; import Blog from "../src/screens/Blog";
import Sample from "../src/screens/Product/components/Sample"; import Sample from "../src/screens/Product/components/Sample";
import Info from "../src/screens/Product/components/Info";
//style //style
import Colors from "../src/constants/Colors"; import Colors from "../src/constants/Colors";
@ -357,6 +358,7 @@ const HomeStackScreen = () => {
<HomeStack.Screen name="Sample" component={Sample} /> <HomeStack.Screen name="Sample" component={Sample} />
<HomeStack.Screen name="Blogs" component={Blogs} /> <HomeStack.Screen name="Blogs" component={Blogs} />
<HomeStack.Screen name="Blog" component={Blog} /> <HomeStack.Screen name="Blog" component={Blog} />
<HomeStack.Screen name="Info" component={Info} />
</HomeStack.Navigator> </HomeStack.Navigator>
); );
}; };
@ -374,6 +376,7 @@ const ProductsStackScreen = () => {
<ProductsStack.Screen name="Products" component={Products} /> <ProductsStack.Screen name="Products" component={Products} />
<ProductsStack.Screen name="Product" component={Product} /> <ProductsStack.Screen name="Product" component={Product} />
<ProductsStack.Screen name="Sample" component={Sample} /> <ProductsStack.Screen name="Sample" component={Sample} />
<ProductsStack.Screen name="Info" component={Info} />
</ProductsStack.Navigator> </ProductsStack.Navigator>
); );
}; };
@ -405,6 +408,7 @@ const CARTStackScreen = () => {
> >
<CARTStack.Screen name="ShoppingCart" component={ShoppingCart} /> <CARTStack.Screen name="ShoppingCart" component={ShoppingCart} />
<CARTStack.Screen name="DeliveryForm" component={DeliveryForm} /> <CARTStack.Screen name="DeliveryForm" component={DeliveryForm} />
<CARTStack.Screen name="Info" component={Info} />
</CARTStack.Navigator> </CARTStack.Navigator>
); );
}; };
@ -477,6 +481,7 @@ const Navigation = ({ getStatus, isLogin, userProducts, ltr, setLTR }) => {
<Stack.Screen name="CreateAddress" component={Address} /> <Stack.Screen name="CreateAddress" component={Address} />
<Stack.Screen name="ProfileAddress" component={ProfileAddress} /> <Stack.Screen name="ProfileAddress" component={ProfileAddress} />
<Stack.Screen name="ProfileBookmark" component={ProfileBookmark} /> <Stack.Screen name="ProfileBookmark" component={ProfileBookmark} />
<Stack.Screen name="Info" component={Info} />
</Stack.Navigator> </Stack.Navigator>
</NavigationContainer> </NavigationContainer>
); );

@ -1,141 +0,0 @@
import {
View,
Text,
ScrollView,
Appearance,
Platform,
} from "react-native";
import Divider from "../Divider";
import { connect } from "react-redux";
import React from "react";
//style
import fontSize from "../../constants/fontSize";
import tw from "tailwind-rn";
import Colors from "../../constants/Colors";
const ios = Platform.OS === "ios";
const ProductQuestion = ({ list, mobile, theme }) => {
return (
<View style={{ flex: 1, paddingHorizontal: 16 }}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
`flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 ${
mobile ? "py-3" : "py-4"
} mb-4`
),
{
backgroundColor: Colors.theme1[theme].greenFF1,
},
]}
>
<Text
style={[
{
fontSize: mobile ? fontSize.sm : fontSize.xl3,
color: Colors.theme1[theme].green79,
fontFamily: "demi",
},
]}
>
پرسش و پاسخ
</Text>
</View>
<ScrollView style={tw("flex-1")}>
{/* {list?.map((question, index) => (
<Question question={question} key={index} mobile={mobile} />
))} */}
</ScrollView>
</View>
);
};
const Question = ({ question, mobile, theme }) => {
return (
<View style={[tw("flex mb-3")]}>
<Text
style={{
fontFamily: "bold",
color: Colors.theme1[theme].green79,
fontSize: mobile ? fontSize.tiny : fontSize.xl3,
textAlign: ios ? "right" : "auto",
}}
>
سوال
</Text>
<Text
style={{
fontFamily: "bold",
color: "#323232",
fontSize: mobile ? fontSize.sm : fontSize.base,
textAlign: ios ? "right" : "auto",
}}
>
{question?.question}
</Text>
{question?.answer && (
<>
<Text
style={{
fontFamily: "bold",
color: Colors.theme1[theme].green79,
fontSize: fontSize.tiny,
marginTop: 10,
textAlign: ios ? "right" : "auto",
}}
>
پاسخ
</Text>
<Text
style={{
fontFamily: "bold",
color: Colors.theme1[theme].gray2077,
fontSize: mobile ? fontSize.sm : fontSize.base,
textAlign: ios ? "right" : "auto",
marginTop: mobile ? "" : 10,
}}
>
{question?.answer}
</Text>
</>
)}
{/* <View></View> */}
<Divider type="vertical" />
</View>
);
};
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
});
export default connect(mapStateToProps)(ProductQuestion);
ProductQuestion.defaultProps = {
list: [
{
question:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟",
answer:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
like: 10,
},
{
question:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟",
answer: null,
like: 0,
},
{
question:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟",
answer:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
like: 10,
},
],
};

@ -1,123 +0,0 @@
import { View, Text, ScrollView, Dimensions, Appearance, Platform } from "react-native";
import React from "react";
import {connect} from 'react-redux';
//style
import fontSize from "../../constants/fontSize";
import Colors from "../../constants/Colors";
import tw from "tailwind-rn";
const { width } = Dimensions.get("window");
const ios = Platform.OS === "ios";
const ProductReviews = ({ list, mobile, theme }) => {
const Property = ({ question }) => {
return (
<View style={[tw("flex mb-3")]}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
`flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 ${mobile ? "py-3" : "py-4"} mb-4`
),
{
backgroundColor: Colors.theme1[theme].greenFF1 + '66',
},
]}
>
<Text
style={[
{
fontSize: mobile ? fontSize.tiny : fontSize.lg,
color: Colors.theme1[theme].green79,
fontFamily: "bold",
},
]}
>
{question.title}
</Text>
</View>
<Text
style={{
fontSize: mobile ? fontSize.tiny : fontSize.base,
fontFamily: "light",
color: "#275077",
lineHeight: 25,
textAlign : ios ? "right" : "auto",
}}
>
{question.text}
</Text>
<View style={[tw("flex flex-row justify-between mt-4")]}>
{question.images.map((image, index) => (
<View
key={index}
style={[
tw("rounded-md flex flex-row justify-center items-center"),
{
width: width / 2 - 24,
height: width / 2 - 24,
backgroundColor: "#F6F6F6",
},
]}
>
<Text>Pic</Text>
</View>
))}
</View>
</View>
);
};
return (
<View style={{ flex: 1, paddingHorizontal: 16 }}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
"flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 py-3 mb-2"
),
{
backgroundColor: Colors.theme1[theme].greenFF1 ,
},
]}
>
<Text
style={[
{
fontSize: fontSize.sm,
color: Colors.theme1[theme].green79,
fontFamily: "demi",
},
]}
>
نقد بررسی و توضیحات تکمیلی محصول
</Text>
</View>
<ScrollView style={tw("flex-1")}>
{list?.map((question, index) => (
<Property question={question} key={index} />
))}
</ScrollView>
</View>
);
};
const mapStateToProps = (state) => ({
mobile : state.publicApi.mobile,
theme : state.publicApi.theme
})
export default connect(mapStateToProps)(ProductReviews);
ProductReviews.defaultProps = {
list: [
{
title: "آیا ارزش خرید دارد یا خیر؟",
text: "هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید و ",
images: [0, 1],
},
],
};

@ -1,122 +0,0 @@
import { View, Text, ScrollView, Dimensions, Platform } from "react-native";
import React from "react";
import {connect} from 'react-redux';
//style
import fontSize from "../../constants/fontSize";
import Colors from "../../constants/Colors";
import tw from "tailwind-rn";
const { width } = Dimensions.get("window");
const ios = Platform.OS === "ios";
const ProductSpecifications = ({ list, mobile, theme }) => {
const Property = ({ prop }) => {
return (
<View style={[tw("flex flex-row-reverse mb-3")]}>
<View
style={[
tw("rounded-md rounded-md"),
{ backgroundColor: "#f8f8f8", width: width / 3.5 },
]}
>
<Text
style={[
tw(`pr-2 ${mobile ? "py-3" : "py-4"}`),
{
fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: "#07AFAF",
textAlign: ios ? "right" : "auto"
},
]}
>
{prop?.description || 'description'}
</Text>
</View>
<View
style={[
tw(`flex-1 mr-2 rounded-md px-2 ${mobile ? " py-3" : "py-4"}`),
{ backgroundColor: "#f8f8f8" },
]}
>
<Text
style={[
tw("text-right"),
{
fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.base,
color: "#646464",
},
]}
>
{prop?.value || 'value'}
</Text>
</View>
</View>
);
};
return (
<View style={{ flex: 1, paddingHorizontal: 16 }}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
"flex flex-row-reverse justify-between items-center mt-3 rounded-md px-3 py-3 mb-4"
),
{
backgroundColor: Colors.theme1[theme].greenFF1 ,
},
]}
>
<Text
style={[
{
fontSize: fontSize.sm,
color: Colors.theme1[theme].green79 ,
fontFamily: "demi",
},
]}
>
مشخصات محصول
</Text>
</View>
<ScrollView style={tw("flex-1")}>
{list?.map((prop, index) => (
<Property prop={prop} key={index} />
))}
</ScrollView>
</View>
);
};
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
theme : state.publicApi.theme
});
export default connect(mapStateToProps)(ProductSpecifications);
ProductSpecifications.defaultProps = {
list: {
display: "IPS LCD 4K Samsung backlight",
weight: "2 کیلوگرم",
proccessor: "Intel core I7 11700H",
graphic: "Nvidia 3090TI 6GB",
audio: "Sonic master",
keyboard: "جزیره ای",
accessories: "کیف + کابل تبدیل برق شهری",
},
};
const persian = {
display: "صفحه نمایش",
weight: "وزن",
proccessor: "پردازنده",
graphic: "پردازنده گرافیکی",
audio: "کارت صدا",
keyboard: "کیبرد",
accessories: "متعلقات جعبه",
};

@ -9,12 +9,14 @@ import {
TouchableOpacity, TouchableOpacity,
Image, Image,
LayoutAnimation, LayoutAnimation,
StatusBar,
} from "react-native"; } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { asyncAwesomeAlert } from "../utils/AsyncWrappers"; import { asyncAwesomeAlert } from "../utils/AsyncWrappers";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { user } from "../redux/actions"; import { user } from "../redux/actions";
import Svg, { Path, G } from "react-native-svg"; import Svg, { Path, G } from "react-native-svg";
import { AntDesign } from "@expo/vector-icons";
//style //style
import tw from "tailwind-rn"; import tw from "tailwind-rn";
@ -37,8 +39,8 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
const [dropdownHeight, setDropdownHeight] = useState(0); const [dropdownHeight, setDropdownHeight] = useState(0);
const navigation = useNavigation(); const navigation = useNavigation();
const routes = React.useMemo(() => {
const routes = [ return [
{ {
name: "صفحه اصلی", name: "صفحه اصلی",
route: "Home", route: "Home",
@ -61,14 +63,18 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
</G> </G>
</Svg> </Svg>
), ),
toast: "",
message: "", message: "",
}, },
{ {
name: "فعال سازی", name: "فعال سازی",
route: "Activation", route: "Activation",
icon: ( icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={21.431} height={21.431}> <Svg
xmlns="http://www.w3.org/2000/svg"
width={21.431}
height={21.431}
>
<G <G
data-name="Group 1" data-name="Group 1"
fill="none" fill="none"
@ -85,7 +91,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
</G> </G>
</Svg> </Svg>
), ),
toast: "",
message: "", message: "",
}, },
{ {
@ -114,7 +120,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
</G> </G>
</Svg> </Svg>
), ),
toast: "",
message: "", message: "",
}, },
{ {
@ -146,7 +152,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
/> />
</Svg> </Svg>
), ),
toast: "",
message: "", message: "",
}, },
{ {
@ -167,11 +173,14 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
strokeWidth={1.5} strokeWidth={1.5}
> >
<Path d="M8.3 18.04v-1.16a8.579 8.579 0 0 1-4.19-6.984A7.919 7.919 0 0 1 13.8 2.19a7.784 7.784 0 0 1 5.27 4.07c2.09 4.2-.11 8.66-3.34 10.61v1.16c0 .29.11.96-.96.96H9.26c-1.1.006-.96-.42-.96-.95Z" /> <Path d="M8.3 18.04v-1.16a8.579 8.579 0 0 1-4.19-6.984A7.919 7.919 0 0 1 13.8 2.19a7.784 7.784 0 0 1 5.27 4.07c2.09 4.2-.11 8.66-3.34 10.61v1.16c0 .29.11.96-.96.96H9.26c-1.1.006-.96-.42-.96-.95Z" />
<Path data-name="Vector" d="M8.5 21.999a12.808 12.808 0 0 1 7 0" /> <Path
data-name="Vector"
d="M8.5 21.999a12.808 12.808 0 0 1 7 0"
/>
</G> </G>
</Svg> </Svg>
), ),
toast: "",
message: "", message: "",
}, },
{ {
@ -200,13 +209,14 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
</G> </G>
</Svg> </Svg>
), ),
toast: "",
message: "", message: "",
}, },
]; ];
}, [user]);
const Route = React.useCallback(
const Route = ({ route }) => { ({ route }) => {
return ( return (
<TouchableOpacity <TouchableOpacity
style={[ style={[
@ -233,18 +243,20 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
); );
}; },
[mobile, position]
);
const onLayout = () => { const onLayout = React.useCallback(() => {
setHeight(Dimensions.get("window").height); setHeight(Dimensions.get("window").height);
setWidth(Dimensions.get("window").width); setWidth(Dimensions.get("window").width);
}; }, [mobile]);
const animateDropdown = () => { const animateDropdown = React.useCallback(() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
setDropdown(() => !dropdown); setDropdown(() => !dropdown);
setDropdownHeight(dropdownHeight === 0 ? fontSize.base + 30 : 0); setDropdownHeight(dropdownHeight === 0 ? fontSize.base + 30 : 0);
}; }, [position]);
return ( return (
<View <View
@ -274,6 +286,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
{ backgroundColor: Colors.theme1[theme].greenCF }, { backgroundColor: Colors.theme1[theme].greenCF },
]} ]}
> >
<View style={tw("flex flex-row-reverse w-full justify-between")}>
{user?.picFileIds ? ( {user?.picFileIds ? (
<Image <Image
source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileIds }} source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileIds }}
@ -294,6 +307,14 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
]} ]}
></View> ></View>
)} )}
<AntDesign
name="close"
size={mobile ? 20 : 30}
color={Colors.theme1[theme].white}
onPress={() => setBoxPosition()}
/>
</View>
<View <View
style={tw( style={tw(
"flex flex-row-reverse w-full justify-between px-2 pb-1 mt-2" "flex flex-row-reverse w-full justify-between px-2 pb-1 mt-2"
@ -397,7 +418,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
user: state.user.status, user: state.user.status,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme theme: state.publicApi.theme,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -25,7 +25,9 @@ export default function comment(state = initialState, action) {
case "comment/loading": case "comment/loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "comment/error": case "comment/error":
toast.error(data.message); asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
});
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
default: default:
return state; return state;

@ -48,7 +48,6 @@ export default function faq(state = initialState, action) {
case "faq/loading": case "faq/loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "faq/error": case "faq/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
default: default:
return state; return state;

@ -37,12 +37,10 @@ export default function userFactor(state = initialState, action) {
case "userFactor/info": case "userFactor/info":
return { ...state, loading: false, info: data, error: null }; return { ...state, loading: false, info: data, error: null };
case "userFactor/add": case "userFactor/add":
// toast.success("درخواست شما با موفقیت انجام شد.");
return { ...state, loading: false, error: null, sum: data.payPrice }; return { ...state, loading: false, error: null, sum: data.payPrice };
case "userFactor/delete": case "userFactor/delete":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "userFactor/payment": case "userFactor/payment":
// navigation.push(data);
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
//vod //vod
case "userFactor/myList": case "userFactor/myList":
@ -52,7 +50,6 @@ export default function userFactor(state = initialState, action) {
case "userFactor/deleteUserOffCode": case "userFactor/deleteUserOffCode":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "userFactor/paymentVOD": case "userFactor/paymentVOD":
// navigation.push(data);
return { ...state, loading: false, error: null, isVerified: false }; return { ...state, loading: false, error: null, isVerified: false };
case "userFactor/verifyVOD": case "userFactor/verifyVOD":
return { ...state, loading: false, error: null, isVerified: true }; return { ...state, loading: false, error: null, isVerified: true };
@ -62,7 +59,6 @@ export default function userFactor(state = initialState, action) {
asyncAwesomeAlert("خطا", data.message, { asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false, showCancelButton: false,
}); });
// toast.error(data.message);
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
default: default:
return state; return state;

@ -36,16 +36,12 @@ export default function userFactor(state = initialState, action) {
case "userProduct/update": case "userProduct/update":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "userProduct/add": case "userProduct/add":
// if (window.location.pathname.indexOf("products") !== -1) {
// toast.success("درخواست شما با موفقیت انجام شد.");
// }
return { ...state, loading: false, error: null, sum: data.payPrice }; return { ...state, loading: false, error: null, sum: data.payPrice };
case "userProduct/delete": case "userProduct/delete":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "userProduct/loading": case "userProduct/loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "userProduct/error": case "userProduct/error":
// toast.error(data.message);
asyncAwesomeAlert("خطا", data.message, { asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false, showCancelButton: false,
}); });

@ -16,7 +16,9 @@ export default function vote(state = initialState, action) {
case "userVote/loading": case "userVote/loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "userVote/error": case "userVote/error":
toast.error(data.message); asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
});
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
default: default:
return state; return state;

@ -19,9 +19,6 @@ import separate from "../../../utils/separate";
import Description from "./Description"; import Description from "./Description";
import LinkBox from "./LinkBox"; import LinkBox from "./LinkBox";
import Comments from "./Comments"; import Comments from "./Comments";
import ProductSpecifications from "../../../components/BottomSheetComponents/ProductSpecifications";
import ProductReview from "../../../components/BottomSheetComponents/ProductReview";
import ProductQuestion from "../../../components/BottomSheetComponents/ProductQuestion";
import Blur from "../../../components/Blur"; import Blur from "../../../components/Blur";
import ImageSlider from "../../../components/ImageSlider"; import ImageSlider from "../../../components/ImageSlider";
import Rates from "./Rates"; import Rates from "./Rates";
@ -43,7 +40,7 @@ function Book({
userFavoriteLoading, userFavoriteLoading,
mobile, mobile,
userProducts, userProducts,
theme theme,
}) { }) {
const navigation = useNavigation(); const navigation = useNavigation();
const [type, setType] = useState(1); const [type, setType] = useState(1);
@ -69,7 +66,6 @@ function Book({
)[0]; )[0];
}, [userProducts, book]); }, [userProducts, book]);
return ( return (
<ScrollView style={[tw("flex flex-1 relative")]}> <ScrollView style={[tw("flex flex-1 relative")]}>
{!mobile && <View style={tw("mt-5")}></View>} {!mobile && <View style={tw("mt-5")}></View>}
@ -426,22 +422,29 @@ function Book({
<LinkBox <LinkBox
title="مشخصات محصول" title="مشخصات محصول"
key={"0"} key={"0"}
component={ onPress={() =>
<ProductSpecifications list={book?.product[type]?.properties} /> navigation.push("Info", {
type: { name: "مشخصات محصول", value: "productSpecifications" },
})
} }
height={height / 2}
/> />
<LinkBox <LinkBox
title="نقد بررسی و توضیحات تکمیلی محصول" title="نقد بررسی و توضیحات تکمیلی محصول"
key={"1"} key={"1"}
component={<ProductReview />} onPress={() =>
height={height / 2} navigation.push("Info", {
type: { name: "نقد و بررسی", value: "productReview" },
})
}
/> />
<LinkBox <LinkBox
title="پرسش و پاسخ" title="پرسش و پاسخ"
key={"2"} key={"2"}
component={<ProductQuestion />} onPress={() =>
height={height / 2} navigation.push("Info", {
type: { name: "پرسش و پاسخ", value: "productQuestion" },
})
}
/> />
{(product.rate || 4) && ( {(product.rate || 4) && (
<> <>
@ -465,7 +468,10 @@ function Book({
<Entypo name="chevron-small-left" size={20} color="#196EC0" /> <Entypo name="chevron-small-left" size={20} color="#196EC0" />
</View> </View>
<Rates rate={book?.rate || 4} productId={book?.product[1]?.id} /> <Rates rate={book?.rate || 4} productId={book?.product[1]?.id} />
<Comments comments={book?.comments} productId={book?.product[1]?.id} /> <Comments
comments={book?.comments}
productId={book?.product[1]?.id}
/>
</> </>
)} )}
</ScrollView> </ScrollView>
@ -478,7 +484,7 @@ const mapStateToProps = (state) => ({
userProductsLoading: state.userProduct.loading, userProductsLoading: state.userProduct.loading,
userFavoriteLoading: state.userFavorite.loading, userFavoriteLoading: state.userFavorite.loading,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme theme: state.publicApi.theme,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -163,15 +163,17 @@ const AddComment = ({ addComment, productId, ...props }) => {
fontFamily: "light", fontFamily: "light",
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[colorScheme].grayE3,
height : fontSize.base + 30
}, },
]} ]}
value={comment.title} value={comment.title}
placeholder="عنوان نظر ..." placeholder="عنوان نظر ..."
onChangeText={(text) => setCommentForm({...commentForm, title : text})} onChangeText={(text) => setCommentForm({...commentForm, title : text})}
/> />
<TextInput <TextInput
style={[ style={[
tw("w-full mt-4 px-2 rounded-md h-40"), tw("w-full mt-4 py-4 px-2 rounded-md h-40"),
{ {
backgroundColor: Colors.theme1[colorScheme].grayF9, backgroundColor: Colors.theme1[colorScheme].grayF9,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
@ -180,10 +182,12 @@ const AddComment = ({ addComment, productId, ...props }) => {
fontFamily: "light", fontFamily: "light",
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[colorScheme].grayE3,
}, },
]} ]}
value={comment.text} value={comment.text}
multiline={true} multiline={true}
textAlignVertical="top"
placeholder="متن نظر ..." placeholder="متن نظر ..."
onChangeText={(text) => setCommentForm({...commentForm, text})} onChangeText={(text) => setCommentForm({...commentForm, text})}
/> />

@ -0,0 +1,344 @@
import {
View,
Text,
ScrollView,
Appearance,
Platform,
StyleSheet,
SafeAreaView,
StatusBar,
Dimensions,
} from "react-native";
import { connect } from "react-redux";
import React from "react";
//components
import Navbar from "../../../components/Navbar";
//style
import fontSize from "../../../constants/fontSize";
import tw from "tailwind-rn";
import Colors from "../../../constants/Colors";
//variables
const ios = Platform.OS === "ios";
const { width } = Dimensions.get("window");
const Info = ({
route,
questionList = [
{
question:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟",
answer:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
like: 10,
},
{
question:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟",
answer: null,
like: 0,
},
{
question:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟",
answer:
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
like: 10,
},
],
reviewList = [
{
title: "آیا ارزش خرید دارد یا خیر؟",
text: "هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید و ",
images: [0, 1],
},
],
specificationsList,
mobile,
theme,
}) => {
const { type } = route.params;
const components = React.useMemo(() => {
return {
productQuestion: (
<ProductQuestion list={questionList} mobile={mobile} theme={theme} />
),
productReview: (
<ProductReviews list={reviewList} mobile={mobile} theme={theme} />
),
productSpecifications: (
<ProductSpecifications
list={specificationsList}
mobile={mobile}
theme={theme}
/>
),
};
}, [type]);
const styles = React.useMemo(() => {
return StyleSheet.create({
contentContainerStyle: {
paddingBottom: 100,
},
container: {
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 5,
paddingHorizontal: 16,
},
});
}, [type]);
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
}}
>
<Navbar
headerOptions={{
logo: false,
menu: false,
hamburgerMenu: false,
title: type.name,
bookmark: false,
qr: false,
back: true,
}}
/>
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
>
{components[type.value]}
</ScrollView>
</SafeAreaView>
);
};
const ProductQuestion = ({ list, mobile, theme }) => {
return (
<View style={{ flex: 1 }}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
`flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 ${
mobile ? "py-3" : "py-4"
} mb-4`
),
{
backgroundColor: Colors.theme1[theme].greenFF1,
},
]}
>
<Text
style={[
{
fontSize: mobile ? fontSize.sm : fontSize.xl3,
color: Colors.theme1[theme].green79,
fontFamily: "demi",
},
]}
>
پرسش و پاسخ
</Text>
</View>
<ScrollView style={tw("flex-1")}>
{/* {list?.map((question, index) => (
<Question question={question} key={index} mobile={mobile} />
))} */}
</ScrollView>
</View>
);
};
const ProductReviews = ({ list, mobile, theme }) => {
const Property = React.useCallback(
({ question }) => {
return (
<View style={[tw("flex mb-3")]}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
`flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 ${
mobile ? "py-3" : "py-4"
} mb-4`
),
{
backgroundColor: Colors.theme1[theme].greenFF1 + "66",
},
]}
>
<Text
style={[
{
fontSize: mobile ? fontSize.tiny : fontSize.lg,
color: Colors.theme1[theme].green79,
fontFamily: "bold",
},
]}
>
{question.title}
</Text>
</View>
<Text
style={{
fontSize: mobile ? fontSize.tiny : fontSize.base,
fontFamily: "light",
color: "#275077",
lineHeight: 25,
textAlign: ios ? "right" : "auto",
}}
>
{question.text}
</Text>
<View style={[tw("flex flex-row justify-between mt-4")]}>
{question.images.map((image, index) => (
<View
key={index}
style={[
tw("rounded-md flex flex-row justify-center items-center"),
{
width: width / 2 - 24,
height: width / 2 - 24,
backgroundColor: "#F6F6F6",
},
]}
>
<Text>Pic</Text>
</View>
))}
</View>
</View>
);
},
[list, mobile, theme]
);
return (
<View style={{ flex: 1 }}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
"flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 py-3 mb-2"
),
{
backgroundColor: Colors.theme1[theme].greenFF1,
},
]}
>
<Text
style={[
{
fontSize: fontSize.sm,
color: Colors.theme1[theme].green79,
fontFamily: "demi",
},
]}
>
نقد بررسی و توضیحات تکمیلی محصول
</Text>
</View>
<ScrollView style={tw("flex-1")}>
{list?.map((question, index) => (
<Property question={question} key={index} />
))}
</ScrollView>
</View>
);
};
const ProductSpecifications = ({ list, mobile, theme }) => {
const Property = ({ prop }) => {
return (
<View style={[tw("flex flex-row-reverse mb-3")]}>
<View
style={[
tw("rounded-md rounded-md"),
{ backgroundColor: "#f8f8f8", width: width / 3.5 },
]}
>
<Text
style={[
tw(`pr-2 ${mobile ? "py-3" : "py-4"}`),
{
fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: "#07AFAF",
textAlign: ios ? "right" : "auto",
},
]}
>
{prop?.description || "description"}
</Text>
</View>
<View
style={[
tw(`flex-1 mr-2 rounded-md px-2 ${mobile ? " py-3" : "py-4"}`),
{ backgroundColor: "#f8f8f8" },
]}
>
<Text
style={[
tw("text-right"),
{
fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.base,
color: "#646464",
},
]}
>
{prop?.value || "value"}
</Text>
</View>
</View>
);
};
return (
<View style={{ flex: 1 }}>
<View
onPress={() => refRBSheet.current.open()}
style={[
tw(
"flex flex-row-reverse justify-between items-center mt-3 rounded-md px-3 py-3 mb-4"
),
{
backgroundColor: Colors.theme1[theme].greenFF1,
},
]}
>
<Text
style={[
{
fontSize: fontSize.sm,
color: Colors.theme1[theme].green79,
fontFamily: "demi",
},
]}
>
مشخصات محصول
</Text>
</View>
<ScrollView style={tw("flex-1")}>
{list?.map((prop, index) => (
<Property prop={prop} key={index} />
))}
</ScrollView>
</View>
);
};
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
theme: state.publicApi.theme,
});
export default connect(mapStateToProps)(Info);

@ -1,7 +1,6 @@
import React, { useRef } from "react"; import React, { useRef } from "react";
import { Text, TouchableOpacity, Appearance } from "react-native"; import { Text, TouchableOpacity, Appearance } from "react-native";
import { connect } from "react-redux"; import { connect } from "react-redux";
import RBSheet from "react-native-raw-bottom-sheet";
import { Entypo } from "@expo/vector-icons"; import { Entypo } from "@expo/vector-icons";
//style //style
@ -9,18 +8,19 @@ import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize"; import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors"; import Colors from "../../../constants/Colors";
function Description({ title, component, height, mobile, theme }) { function Description({ title, onPress, mobile, theme }) {
const refRBSheet = useRef(); const refRBSheet = useRef();
return ( return (
<>
<TouchableOpacity <TouchableOpacity
onPress={() => refRBSheet.current.open()} onPress={() => onPress()}
style={[ style={[
tw( tw(
`flex flex-row-reverse justify-between items-center mt-3 rounded-sm px-5 ${mobile ? "py-4" : "py-4"}` `flex flex-row-reverse justify-between items-center mt-3 rounded-sm px-5 ${
mobile ? "py-4" : "py-4"
}`
), ),
{ {
backgroundColor: Colors.theme1[theme].greenCF + '15', backgroundColor: Colors.theme1[theme].greenCF + "15",
// borderWidth : 1, // borderWidth : 1,
}, },
]} ]}
@ -37,37 +37,18 @@ function Description({ title, component, height, mobile, theme }) {
> >
{title} {title}
</Text> </Text>
<Entypo name="chevron-small-left" size={20} color={Colors.theme1[theme].green79} /> <Entypo
name="chevron-small-left"
size={20}
color={Colors.theme1[theme].green79}
/>
</TouchableOpacity> </TouchableOpacity>
<RBSheet
ref={refRBSheet}
closeOnDragDown={true}
dragFromTopOnly={true}
closeOnPressMask={true}
height={height}
customStyles={{
wrapper: {
backgroundColor: "#00000077",
},
container: {
padding: 0,
borderTopLeftRadius: 30,
borderTopRightRadius: 30,
},
draggableIcon: {
backgroundColor: "#000",
},
}}
>
{component}
</RBSheet>
</>
); );
} }
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme theme: state.publicApi.theme,
}); });
export default connect(mapStateToProps)(Description); export default connect(mapStateToProps)(Description);

@ -71,7 +71,6 @@ class onInput {
newText = newText.replace(/M/g, ""); newText = newText.replace(/M/g, "");
newText = newText.replace(/\?/g, ""); newText = newText.replace(/\?/g, "");
if (!newText && newText.length !== 0) { if (!newText && newText.length !== 0) {
// toast.info("از کاراکتر فارسی استفاده کنید");
} }
return newText; return newText;
}; };
@ -130,7 +129,6 @@ class onInput {
newText = newText.replace(/ی/g, ""); newText = newText.replace(/ی/g, "");
newText = newText.replace(/\?/g, ""); newText = newText.replace(/\?/g, "");
if (!newText && newText.length !== 0) { if (!newText && newText.length !== 0) {
// toast.info("از کاراکتر انگلیسی واعداداستفاده کنید");
} }
return newText; return newText;
}; };
@ -247,14 +245,13 @@ class onInput {
newText = newText.replace(/N/g, ""); newText = newText.replace(/N/g, "");
newText = newText.replace(/M/g, ""); newText = newText.replace(/M/g, "");
if (!newText && newText.length !== 0) { if (!newText && newText.length !== 0) {
toast.info("از اعداداستفاده کنید");
} }
return newText; return newText;
}; };
dayHandler = (num) => { dayHandler = (num) => {
let newNum = this.numberOnly(num); let newNum = this.numberOnly(num);
if (newNum > 31) { if (newNum > 31) {
// toast.error("روز نباید بزرگتر از 31 باشد.");
return Math.floor(newNum / 10); return Math.floor(newNum / 10);
} }
return newNum; return newNum;
@ -262,7 +259,6 @@ class onInput {
monthHandler = (num) => { monthHandler = (num) => {
let newNum = this.numberOnly(num); let newNum = this.numberOnly(num);
if (newNum > 12 || newNum < 0) { if (newNum > 12 || newNum < 0) {
// toast.error("ماه باید بین 1 تا 12 باشد.");
return Math.floor(newNum / 10); return Math.floor(newNum / 10);
} }
return newNum; return newNum;
@ -270,7 +266,6 @@ class onInput {
yearHandler = (num) => { yearHandler = (num) => {
let newNum = this.numberOnly(num); let newNum = this.numberOnly(num);
if (newNum > 1395) { if (newNum > 1395) {
// toast.error("سال باید کوچکتر از 1395 باشد.");
return Math.floor(newNum / 10); return Math.floor(newNum / 10);
} }
return newNum; return newNum;

Loading…
Cancel
Save