reza fixed compo colors before Orders

master
Reza_ashrafi 3 years ago
parent 4ca5b990c8
commit 7457cf1833
  1. 40
      src/screens/Faq/components/Instance.js
  2. 4
      src/screens/Faq/index.js

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

@ -1,13 +1,11 @@
import React, { useState, useEffect } from "react"; import React, { useEffect } from "react";
import { import {
View, View,
StyleSheet,
Dimensions, Dimensions,
ScrollView, ScrollView,
SafeAreaView, SafeAreaView,
Platform, Platform,
StatusBar, StatusBar,
LayoutAnimation,
} from "react-native"; } from "react-native";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { faq } from "../../redux/actions"; import { faq } from "../../redux/actions";

Loading…
Cancel
Save