|
|
@ -1,10 +1,4 @@ |
|
|
|
import { |
|
|
|
import { View, Text, TouchableOpacity } from "react-native"; |
|
|
|
View, |
|
|
|
|
|
|
|
Text, |
|
|
|
|
|
|
|
Dimensions, |
|
|
|
|
|
|
|
TouchableOpacity, |
|
|
|
|
|
|
|
Appearance, |
|
|
|
|
|
|
|
} from "react-native"; |
|
|
|
|
|
|
|
import { Entypo } from "@expo/vector-icons"; |
|
|
|
import { Entypo } from "@expo/vector-icons"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
//style
|
|
|
|
//style
|
|
|
@ -12,26 +6,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"; |
|
|
|
|
|
|
|
|
|
|
|
const { width } = Dimensions.get("window"); |
|
|
|
function Instance({ question, selectFaq, mobile, theme }) { |
|
|
|
|
|
|
|
|
|
|
|
function Instance({ question, selectFaq, mobile }) { |
|
|
|
|
|
|
|
const colorScheme = Appearance.getColorScheme(); |
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<TouchableOpacity |
|
|
|
<TouchableOpacity |
|
|
|
onPress={() => selectFaq(question.id)} |
|
|
|
onPress={() => selectFaq(question.id)} |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
tw( |
|
|
|
tw(`w-full flex my-1.5 rounded-md px-4 ${mobile ? "py-2" : "py-3"}`), |
|
|
|
`w-full flex my-1.5 rounded-md px-4 ${ |
|
|
|
|
|
|
|
mobile ? "py-2" : "py-3" |
|
|
|
|
|
|
|
}` |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
backgroundColor: !question.active |
|
|
|
backgroundColor: !question.active |
|
|
|
? "#F9F9F9" |
|
|
|
? "#F9F9F9" |
|
|
|
: Colors.theme1[colorScheme].greenCF + "0a", |
|
|
|
: Colors.theme1[theme].greenCF + "0a", |
|
|
|
borderColor: !question.active |
|
|
|
borderColor: !question.active |
|
|
|
? "#DBDBDB" |
|
|
|
? "#DBDBDB" |
|
|
|
: Colors.theme1[colorScheme].greenCF, |
|
|
|
: Colors.theme1[theme].greenCF, |
|
|
|
borderWidth: 1.5, |
|
|
|
borderWidth: 1.5, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
@ -42,7 +29,7 @@ function Instance({ question, selectFaq, mobile }) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
width: "90%", |
|
|
|
width: "90%", |
|
|
|
textAlign: "right", |
|
|
|
textAlign: "right", |
|
|
|
color: Colors.theme1[colorScheme].green79, |
|
|
|
color: Colors.theme1[theme].green79, |
|
|
|
fontSize: mobile ? fontSize.tiny : fontSize.lg, |
|
|
|
fontSize: mobile ? fontSize.tiny : fontSize.lg, |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
}, |
|
|
|
}, |
|
|
@ -51,17 +38,9 @@ function Instance({ question, selectFaq, mobile }) { |
|
|
|
{question.title} |
|
|
|
{question.title} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
{question.active ? ( |
|
|
|
{question.active ? ( |
|
|
|
<Entypo |
|
|
|
<Entypo name="minus" size={18} color={Colors.theme1[theme].green79} /> |
|
|
|
name="minus" |
|
|
|
|
|
|
|
size={18} |
|
|
|
|
|
|
|
color={Colors.theme1[colorScheme].green79} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Entypo |
|
|
|
<Entypo name="plus" size={18} color={Colors.theme1[theme].green79} /> |
|
|
|
name="plus" |
|
|
|
|
|
|
|
size={18} |
|
|
|
|
|
|
|
color={Colors.theme1[colorScheme].green79} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
)} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
{question.active && ( |
|
|
|
{question.active && ( |
|
|
@ -69,7 +48,7 @@ function Instance({ question, selectFaq, mobile }) { |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
{ |
|
|
|
{ |
|
|
|
color: Colors.theme1[colorScheme].green79, |
|
|
|
color: Colors.theme1[theme].green79, |
|
|
|
fontSize: mobile ? fontSize.tiny : fontSize.lg, |
|
|
|
fontSize: mobile ? fontSize.tiny : fontSize.lg, |
|
|
|
fontFamily: "light", |
|
|
|
fontFamily: "light", |
|
|
|
}, |
|
|
|
}, |
|
|
@ -86,6 +65,7 @@ function Instance({ question, selectFaq, mobile }) { |
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => ({ |
|
|
|
const mapStateToProps = (state) => ({ |
|
|
|
mobile: state.publicApi.mobile, |
|
|
|
mobile: state.publicApi.mobile, |
|
|
|
|
|
|
|
theme: state.publicApi.theme, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(Instance); |
|
|
|
export default connect(mapStateToProps)(Instance); |
|
|
|