reza fixed compo colors before Profile

master
Reza_ashrafi 2 years ago
parent d800583931
commit c6567f7385
  1. 27
      src/screens/Products/components/Main.js

@ -4,7 +4,6 @@ import {
Pressable, Pressable,
Image, Image,
Dimensions, Dimensions,
Appearance,
Platform, Platform,
} from "react-native"; } from "react-native";
import React from "react"; import React from "react";
@ -19,9 +18,8 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const Main = ({ books, filterOptions, grades, mobile }) => { const Main = ({ books, filterOptions, grades, mobile, theme }) => {
const [width, setWidth] = React.useState(Dimensions.get("window").width); const [width, setWidth] = React.useState(Dimensions.get("window").width);
const colorScheme = Appearance.getColorScheme();
const navigation = useNavigation(); const navigation = useNavigation();
const [filterLoading, setFilterLoading] = React.useState(false); const [filterLoading, setFilterLoading] = React.useState(false);
@ -77,7 +75,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
{ {
width: mobile ? "auto" : width / 2.2, width: mobile ? "auto" : width / 2.2,
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[theme].grayE3,
}, },
tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`), tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`),
]} ]}
@ -102,7 +100,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
{ {
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.lg, fontSize: fontSize.lg,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}, },
]} ]}
@ -115,7 +113,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
{ {
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
fontFamily: "regular", fontFamily: "regular",
color: Colors.theme1[colorScheme].greenBA, color: Colors.theme1[theme].greenBA,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}, },
]} ]}
@ -145,7 +143,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
width: mobile ? width / 2 - 25 : width / 3.2, width: mobile ? width / 2 - 25 : width / 3.2,
marginBottom: 15, marginBottom: 15,
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[theme].grayE3,
}, },
tw("flex justify-between px-2 pt-2 rounded-md"), tw("flex justify-between px-2 pt-2 rounded-md"),
]} ]}
@ -186,7 +184,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
</Text> </Text>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].greenBA, color: Colors.theme1[theme].greenBA,
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
marginTop: 5, marginTop: 5,
fontFamily: "regular", fontFamily: "regular",
@ -206,7 +204,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
style={[ style={[
tw("text-center ml-1"), tw("text-center ml-1"),
{ {
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.xl2, fontSize: fontSize.xl2,
}, },
@ -217,7 +215,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
<Text <Text
style={{ style={{
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].gray2077, color: Colors.theme1[theme].gray2077,
fontFamily: "regular", fontFamily: "regular",
}} }}
> >
@ -236,7 +234,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
width: mobile ? width / 2 - 25 : width / 3.2, width: mobile ? width / 2 - 25 : width / 3.2,
marginBottom: 15, marginBottom: 15,
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[theme].grayE3,
}, },
tw("flex justify-between px-2 pt-2 rounded-md"), tw("flex justify-between px-2 pt-2 rounded-md"),
]} ]}
@ -277,7 +275,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
</Text> </Text>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].greenBA, color: Colors.theme1[theme].greenBA,
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
marginTop: 5, marginTop: 5,
fontFamily: "regular", fontFamily: "regular",
@ -297,7 +295,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
style={[ style={[
tw("text-center ml-1"), tw("text-center ml-1"),
{ {
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.xl2, fontSize: fontSize.xl2,
}, },
@ -308,7 +306,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
<Text <Text
style={{ style={{
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].gray2077, color: Colors.theme1[theme].gray2077,
fontFamily: "regular", fontFamily: "regular",
}} }}
> >
@ -348,6 +346,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
filterOptions: state.book.filterOptions, filterOptions: state.book.filterOptions,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = {}; const mapDispatchToProps = {};

Loading…
Cancel
Save