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. 433
      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. 77
      src/screens/Product/components/LinkBox.js
  15. 2
      src/screens/Product/components/Sample.js
  16. 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,214 +39,224 @@ 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(() => {
return [
{
name: "صفحه اصلی",
route: "Home",
icon: (
<Svg
data-name="vuesax/linear/home-2"
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
>
<G
fill="none"
stroke="#292d32"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
>
<Path d="m9.02 2.84-5.39 4.2A4.759 4.759 0 0 0 2 10.36v7.41a4.225 4.225 0 0 0 4.21 4.22h11.58A4.223 4.223 0 0 0 22 17.78V10.5a4.723 4.723 0 0 0-1.8-3.45l-6.18-4.333a4.487 4.487 0 0 0-5 .123Z" />
<Path data-name="Vector" d="M12 17.99v-3" />
</G>
</Svg>
),
const routes = [ message: "",
{ },
name: "صفحه اصلی", {
route: "Home", name: "فعال سازی",
icon: ( route: "Activation",
<Svg icon: (
data-name="vuesax/linear/home-2" <Svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width={24} width={21.431}
height={24} height={21.431}
>
<G
fill="none"
stroke="#292d32"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
> >
<Path d="m9.02 2.84-5.39 4.2A4.759 4.759 0 0 0 2 10.36v7.41a4.225 4.225 0 0 0 4.21 4.22h11.58A4.223 4.223 0 0 0 22 17.78V10.5a4.723 4.723 0 0 0-1.8-3.45l-6.18-4.333a4.487 4.487 0 0 0-5 .123Z" /> <G
<Path data-name="Vector" d="M12 17.99v-3" /> data-name="Group 1"
</G> fill="none"
</Svg> stroke="#292d32"
), strokeLinecap="round"
toast: "", strokeLinejoin="round"
message: "", strokeWidth={1.5}
}, >
{ <Path d="M20.681 13.705V7.726c0-4.983-1.993-6.976-6.976-6.976H7.726C2.743.75.75 2.743.75 7.726v5.979c0 4.983 1.993 6.976 6.976 6.976h5.979c4.983 0 6.976-1.993 6.976-6.976Z" />
name: "فعال سازی", <Path
route: "Activation", data-name="Vector"
icon: ( d="m6.558 10.716 2.776 2.776 5.538-5.552"
<Svg xmlns="http://www.w3.org/2000/svg" width={21.431} height={21.431}> />
<G </G>
data-name="Group 1" </Svg>
fill="none" ),
stroke="#292d32"
strokeLinecap="round" message: "",
strokeLinejoin="round" },
strokeWidth={1.5} {
name: "واقعیت افزوده",
route: "AR",
icon: (
<Svg
data-name="vuesax/linear/3dcube"
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
> >
<Path d="M20.681 13.705V7.726c0-4.983-1.993-6.976-6.976-6.976H7.726C2.743.75.75 2.743.75 7.726v5.979c0 4.983 1.993 6.976 6.976 6.976h5.979c4.983 0 6.976-1.993 6.976-6.976Z" /> <G
<Path data-name="3dcube"
data-name="Vector" fill="none"
d="m6.558 10.716 2.776 2.776 5.538-5.552" stroke="#292d32"
/> strokeLinecap="round"
</G> strokeLinejoin="round"
</Svg> strokeWidth={1.5}
), >
toast: "", <Path d="m12.92 2.26 6.51 3.51a1.153 1.153 0 0 1 0 1.99l-6.51 3.51a1.936 1.936 0 0 1-1.84 0L4.57 7.76a1.153 1.153 0 0 1 0-1.99l6.51-3.51a1.936 1.936 0 0 1 1.84 0Z" />
message: "", <Path
}, data-name="Vector"
{ d="m3.61 10.13 6.05 3.03a2.238 2.238 0 0 1 1.23 1.99v5.72a1.109 1.109 0 0 1-1.61.99l-6.05-3.03A2.238 2.238 0 0 1 2 16.84v-5.72a1.109 1.109 0 0 1 1.61-.99ZM20.39 10.13l-6.05 3.03a2.238 2.238 0 0 0-1.23 1.99v5.72a1.109 1.109 0 0 0 1.61.99l6.05-3.03A2.238 2.238 0 0 0 22 16.84v-5.72a1.109 1.109 0 0 0-1.61-.99Z"
name: "واقعیت افزوده", />
route: "AR", </G>
icon: ( </Svg>
<Svg ),
data-name="vuesax/linear/3dcube"
xmlns="http://www.w3.org/2000/svg" message: "",
width={24} },
height={24} {
> name: "سفارشات",
<G route: "Orders",
data-name="3dcube" icon: (
fill="none" <Svg
stroke="#292d32" data-name="vuesax/linear/ranking"
strokeLinecap="round" xmlns="http://www.w3.org/2000/svg"
strokeLinejoin="round" width={24}
strokeWidth={1.5} height={24}
> >
<Path d="m12.92 2.26 6.51 3.51a1.153 1.153 0 0 1 0 1.99l-6.51 3.51a1.936 1.936 0 0 1-1.84 0L4.57 7.76a1.153 1.153 0 0 1 0-1.99l6.51-3.51a1.936 1.936 0 0 1 1.84 0Z" />
<Path <Path
data-name="Vector" d="M8.67 14H4a2.006 2.006 0 0 0-2 2v6h6.67Z"
d="m3.61 10.13 6.05 3.03a2.238 2.238 0 0 1 1.23 1.99v5.72a1.109 1.109 0 0 1-1.61.99l-6.05-3.03A2.238 2.238 0 0 1 2 16.84v-5.72a1.109 1.109 0 0 1 1.61-.99ZM20.39 10.13l-6.05 3.03a2.238 2.238 0 0 0-1.23 1.99v5.72a1.109 1.109 0 0 0 1.61.99l6.05-3.03A2.238 2.238 0 0 0 22 16.84v-5.72a1.109 1.109 0 0 0-1.61-.99Z" fill="none"
stroke="#292d32"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/> />
</G>
</Svg>
),
toast: "",
message: "",
},
{
name: "سفارشات",
route: "Orders",
icon: (
<Svg
data-name="vuesax/linear/ranking"
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
>
<Path
d="M8.67 14H4a2.006 2.006 0 0 0-2 2v6h6.67Z"
fill="none"
stroke="#292d32"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
<Path
data-name="Vector"
d="M13.33 10h-2.67a2.006 2.006 0 0 0-2 2v10h6.67V12a2 2 0 0 0-2-2ZM20 17h-4.67v5H22v-3a2.006 2.006 0 0 0-2-2ZM12.52 2.07l.53 1.06a.6.6 0 0 0 .42.31l.96.16c.61.1.76.55.32.98l-.75.75a.639.639 0 0 0-.16.54l.21.92c.17.73-.22 1.01-.86.63l-.9-.53a.618.618 0 0 0-.59 0l-.9.53c-.64.38-1.03.1-.86-.63l.21-.92a.63.63 0 0 0-.156-.54l-.74-.74c-.44-.44-.3-.88.32-.98l.96-.16a.666.666 0 0 0 .42-.31l.53-1.06c.286-.58.746-.58 1.036-.01Z"
fill="none"
stroke="#292d32"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
),
toast: "",
message: "",
},
{
name: "سوالات متداول",
route: "Faq",
icon: (
<Svg
data-name="vuesax/linear/lamp-on"
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
>
<G
fill="none"
stroke="#292d32"
strokeLinecap="round"
strokeLinejoin="round"
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 data-name="Vector" d="M8.5 21.999a12.808 12.808 0 0 1 7 0" />
</G>
</Svg>
),
toast: "",
message: "",
},
{
name: "تماس با ما",
route: "Contact",
icon: (
<Svg
data-name="vuesax/linear/call-calling"
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
>
<G
data-name="call-calling"
fill="none"
stroke="#292d32"
strokeWidth={1.5}
>
<Path d="M21.97 18.33a2.545 2.545 0 0 1-.25 1.09 4.126 4.126 0 0 1-.68 1.02 4.508 4.508 0 0 1-1.64 1.18 5.022 5.022 0 0 1-1.95.38 8.334 8.334 0 0 1-3.26-.73 17.564 17.564 0 0 1-3.44-1.98 28.75 28.75 0 0 1-3.28-2.8 28.414 28.414 0 0 1-2.79-3.27 17.828 17.828 0 0 1-1.96-3.41A8.423 8.423 0 0 1 2 6.54a5.173 5.173 0 0 1 .36-1.93 4.6 4.6 0 0 1 1.15-1.67A2.93 2.93 0 0 1 5.59 2a1.879 1.879 0 0 1 .81.18 1.63 1.63 0 0 1 .67.56l2.32 3.27a3.422 3.422 0 0 1 .4.7 1.581 1.581 0 0 1 .14.61 1.357 1.357 0 0 1-.21.71 3.4 3.4 0 0 1-.56.71l-.76.79a.535.535 0 0 0-.16.4.908.908 0 0 0 .03.23c.03.08.06.14.08.2a8.3 8.3 0 0 0 .93 1.28c.45.52.93 1.05 1.45 1.58.54.53 1.06 1.02 1.59 1.47a7.675 7.675 0 0 0 1.29.92c.05.02.11.05.18.08a.69.69 0 0 0 .25.04.55.55 0 0 0 .41-.17l.76-.75a3.068 3.068 0 0 1 .72-.56 1.332 1.332 0 0 1 .71-.21 1.6 1.6 0 0 1 .61.13 3.868 3.868 0 0 1 .7.39l3.31 2.35a1.517 1.517 0 0 1 .55.64 2.052 2.052 0 0 1 .16.78Z" />
<Path <Path
data-name="Vector" data-name="Vector"
d="M18.5 9a3.965 3.965 0 0 0-1.17-2.27A3.416 3.416 0 0 0 15 5.5M22 9a7 7 0 0 0-7-7" d="M13.33 10h-2.67a2.006 2.006 0 0 0-2 2v10h6.67V12a2 2 0 0 0-2-2ZM20 17h-4.67v5H22v-3a2.006 2.006 0 0 0-2-2ZM12.52 2.07l.53 1.06a.6.6 0 0 0 .42.31l.96.16c.61.1.76.55.32.98l-.75.75a.639.639 0 0 0-.16.54l.21.92c.17.73-.22 1.01-.86.63l-.9-.53a.618.618 0 0 0-.59 0l-.9.53c-.64.38-1.03.1-.86-.63l.21-.92a.63.63 0 0 0-.156-.54l-.74-.74c-.44-.44-.3-.88.32-.98l.96-.16a.666.666 0 0 0 .42-.31l.53-1.06c.286-.58.746-.58 1.036-.01Z"
fill="none"
stroke="#292d32"
strokeLinecap="round" strokeLinecap="round"
strokeLinejoin="round" strokeLinejoin="round"
strokeWidth={1.5}
/> />
</G> </Svg>
</Svg> ),
),
toast: "",
message: "",
},
];
message: "",
},
{
name: "سوالات متداول",
route: "Faq",
icon: (
<Svg
data-name="vuesax/linear/lamp-on"
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
>
<G
fill="none"
stroke="#292d32"
strokeLinecap="round"
strokeLinejoin="round"
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
data-name="Vector"
d="M8.5 21.999a12.808 12.808 0 0 1 7 0"
/>
</G>
</Svg>
),
const Route = ({ route }) => { message: "",
return ( },
<TouchableOpacity {
style={[ name: "تماس با ما",
tw( route: "Contact",
`w-full flex flex-row-reverse justify-start items-end ${ icon: (
mobile ? "mt-6" : "mt-10" <Svg
}` data-name="vuesax/linear/call-calling"
), xmlns="http://www.w3.org/2000/svg"
{}, width={24}
]} height={24}
onPress={() => navigation.navigate(route.route)} >
> <G
{route.icon} data-name="call-calling"
<Text fill="none"
stroke="#292d32"
strokeWidth={1.5}
>
<Path d="M21.97 18.33a2.545 2.545 0 0 1-.25 1.09 4.126 4.126 0 0 1-.68 1.02 4.508 4.508 0 0 1-1.64 1.18 5.022 5.022 0 0 1-1.95.38 8.334 8.334 0 0 1-3.26-.73 17.564 17.564 0 0 1-3.44-1.98 28.75 28.75 0 0 1-3.28-2.8 28.414 28.414 0 0 1-2.79-3.27 17.828 17.828 0 0 1-1.96-3.41A8.423 8.423 0 0 1 2 6.54a5.173 5.173 0 0 1 .36-1.93 4.6 4.6 0 0 1 1.15-1.67A2.93 2.93 0 0 1 5.59 2a1.879 1.879 0 0 1 .81.18 1.63 1.63 0 0 1 .67.56l2.32 3.27a3.422 3.422 0 0 1 .4.7 1.581 1.581 0 0 1 .14.61 1.357 1.357 0 0 1-.21.71 3.4 3.4 0 0 1-.56.71l-.76.79a.535.535 0 0 0-.16.4.908.908 0 0 0 .03.23c.03.08.06.14.08.2a8.3 8.3 0 0 0 .93 1.28c.45.52.93 1.05 1.45 1.58.54.53 1.06 1.02 1.59 1.47a7.675 7.675 0 0 0 1.29.92c.05.02.11.05.18.08a.69.69 0 0 0 .25.04.55.55 0 0 0 .41-.17l.76-.75a3.068 3.068 0 0 1 .72-.56 1.332 1.332 0 0 1 .71-.21 1.6 1.6 0 0 1 .61.13 3.868 3.868 0 0 1 .7.39l3.31 2.35a1.517 1.517 0 0 1 .55.64 2.052 2.052 0 0 1 .16.78Z" />
<Path
data-name="Vector"
d="M18.5 9a3.965 3.965 0 0 0-1.17-2.27A3.416 3.416 0 0 0 15 5.5M22 9a7 7 0 0 0-7-7"
strokeLinecap="round"
strokeLinejoin="round"
/>
</G>
</Svg>
),
message: "",
},
];
}, [user]);
const Route = React.useCallback(
({ route }) => {
return (
<TouchableOpacity
style={[ style={[
tw("mr-2"), tw(
{ `w-full flex flex-row-reverse justify-start items-end ${
fontFamily: "regular", mobile ? "mt-6" : "mt-10"
fontSize: mobile ? fontSize.base : fontSize.lg, }`
}, ),
{},
]} ]}
onPress={() => navigation.navigate(route.route)}
> >
{route.name} {route.icon}
</Text> <Text
</TouchableOpacity> style={[
); tw("mr-2"),
}; {
fontFamily: "regular",
fontSize: mobile ? fontSize.base : fontSize.lg,
},
]}
>
{route.name}
</Text>
</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,26 +286,35 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => {
{ backgroundColor: Colors.theme1[theme].greenCF }, { backgroundColor: Colors.theme1[theme].greenCF },
]} ]}
> >
{user?.picFileIds ? ( <View style={tw("flex flex-row-reverse w-full justify-between")}>
<Image {user?.picFileIds ? (
source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileIds }} <Image
style={[ source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileIds }}
tw("rounded-full"), style={[
{ width: mobile ? 60 : 100, height: mobile ? 60 : 100 }, tw("rounded-full"),
]} { width: mobile ? 60 : 100, height: mobile ? 60 : 100 },
]}
/>
) : (
<View
style={[
tw("rounded-full bg-gray-200"),
{
width: mobile ? 60 : 100,
height: mobile ? 60 : 100,
zIndex: 1,
},
]}
></View>
)}
<AntDesign
name="close"
size={mobile ? 20 : 30}
color={Colors.theme1[theme].white}
onPress={() => setBoxPosition()}
/> />
) : ( </View>
<View
style={[
tw("rounded-full bg-gray-200"),
{
width: mobile ? 60 : 100,
height: mobile ? 60 : 100,
zIndex: 1,
},
]}
></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,65 +8,47 @@ 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={() => onPress()}
onPress={() => refRBSheet.current.open()} style={[
tw(
`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",
// borderWidth : 1,
},
]}
>
<Text
style={[ style={[
tw(
`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', fontSize: mobile ? fontSize.sm : fontSize.lg,
// borderWidth : 1, color: Colors.theme1[theme].green79,
fontFamily: "demi",
}, },
tw(""),
]} ]}
> >
<Text {title}
style={[ </Text>
{ <Entypo
fontSize: mobile ? fontSize.sm : fontSize.lg, name="chevron-small-left"
color: Colors.theme1[theme].green79, size={20}
fontFamily: "demi", color={Colors.theme1[theme].green79}
}, />
tw(""), </TouchableOpacity>
]}
>
{title}
</Text>
<Entypo name="chevron-small-left" size={20} color={Colors.theme1[theme].green79} />
</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);

@ -35,4 +35,4 @@ const Sample = ({route}) => {
); );
}; };
export default Sample; export default Sample;

@ -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