parent
5ff1acee71
commit
23f9797a0b
16 changed files with 638 additions and 673 deletions
@ -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,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: "متعلقات جعبه", |
||||
}; |
Loading…
Reference in new issue