You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
5.2 KiB
142 lines
5.2 KiB
import { |
|
View, |
|
Text, |
|
ScrollView, |
|
Dimensions, |
|
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 { width } = Dimensions.get("window"); |
|
const ios = Platform.OS === "ios"; |
|
|
|
const ProductQuestion = ({ list, mobile }) => { |
|
const colorScheme = Appearance.getColorScheme(); |
|
const Question = ({ question }) => { |
|
return ( |
|
<View style={[tw("flex flex-col mb-3")]}> |
|
<Text |
|
style={{ |
|
fontFamily: "bold", |
|
color: Colors.theme1[colorScheme].green79, |
|
fontSize: mobile ? fontSize.lg : fontSize.xl3, |
|
textAlign: ios ? "right" : "auto", |
|
}} |
|
> |
|
سوال |
|
</Text> |
|
<Text |
|
style={{ |
|
fontFamily: "bold", |
|
color: "#323232", |
|
fontSize: mobile ? fontSize.tiny : fontSize.base, |
|
textAlign: ios ? "right" : "auto", |
|
}} |
|
> |
|
{question.question} |
|
</Text> |
|
{question.answer && ( |
|
<> |
|
<Text |
|
style={{ |
|
fontFamily: "bold", |
|
color: Colors.theme1[colorScheme].green79, |
|
fontSize: fontSize.lg, |
|
marginTop: 10, |
|
textAlign: ios ? "right" : "auto", |
|
}} |
|
> |
|
پاسخ |
|
</Text> |
|
<Text |
|
style={{ |
|
fontFamily: "bold", |
|
color: Colors.theme1[colorScheme].gray2077, |
|
fontSize: mobile ? fontSize.tiny : fontSize.base, |
|
textAlign: ios ? "right" : "auto", |
|
marginTop: mobile ? "" : 10, |
|
}} |
|
> |
|
{question.question} |
|
</Text> |
|
</> |
|
)} |
|
{/* <View></View> */} |
|
<Divider type="vertical" /> |
|
</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 ${ |
|
mobile ? "py-3" : "py-4" |
|
} mb-4` |
|
), |
|
{ |
|
backgroundColor: Colors.theme1[colorScheme].greenFF1, |
|
}, |
|
]} |
|
> |
|
<Text |
|
style={[ |
|
{ |
|
fontSize: mobile ? fontSize.lg : fontSize.xl3, |
|
color: Colors.theme1[colorScheme].green79, |
|
fontFamily: "demi", |
|
}, |
|
]} |
|
> |
|
پرسش و پاسخ |
|
</Text> |
|
</View> |
|
<ScrollView style={tw("flex-1")}> |
|
{list.map((question, index) => ( |
|
<Question question={question} key={index} /> |
|
))} |
|
</ScrollView> |
|
</View> |
|
); |
|
}; |
|
|
|
const mapStateToProps = (state) => ({ |
|
mobile: state.publicApi.mobile, |
|
}); |
|
|
|
export default connect(mapStateToProps)(ProductQuestion); |
|
|
|
ProductQuestion.defaultProps = { |
|
list: [ |
|
{ |
|
question: |
|
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟", |
|
answer: |
|
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ", |
|
like: 10, |
|
}, |
|
{ |
|
question: |
|
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟", |
|
answer: null, |
|
like: 0, |
|
}, |
|
{ |
|
question: |
|
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ؟", |
|
answer: |
|
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ", |
|
like: 10, |
|
}, |
|
], |
|
};
|
|
|