From c6567f7385a74c5e54fc42085564266a6f0e1733 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Tue, 12 Apr 2022 18:04:57 +0430 Subject: [PATCH] reza fixed compo colors before Profile --- src/screens/Products/components/Main.js | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/screens/Products/components/Main.js b/src/screens/Products/components/Main.js index bc14ca0..68e829c 100644 --- a/src/screens/Products/components/Main.js +++ b/src/screens/Products/components/Main.js @@ -4,7 +4,6 @@ import { Pressable, Image, Dimensions, - Appearance, Platform, } from "react-native"; import React from "react"; @@ -19,9 +18,8 @@ import fontSize from "../../../constants/fontSize"; 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 colorScheme = Appearance.getColorScheme(); const navigation = useNavigation(); const [filterLoading, setFilterLoading] = React.useState(false); @@ -77,7 +75,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { { width: mobile ? "auto" : width / 2.2, borderWidth: 1, - borderColor: Colors.theme1[colorScheme].grayE3, + borderColor: Colors.theme1[theme].grayE3, }, tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`), ]} @@ -102,7 +100,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { { fontFamily: "bold", fontSize: fontSize.lg, - color: Colors.theme1[colorScheme].gray20, + color: Colors.theme1[theme].gray20, textAlign: ios ? "right" : "auto", }, ]} @@ -115,7 +113,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { { fontSize: fontSize.tiny, fontFamily: "regular", - color: Colors.theme1[colorScheme].greenBA, + color: Colors.theme1[theme].greenBA, textAlign: ios ? "right" : "auto", }, ]} @@ -145,7 +143,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { width: mobile ? width / 2 - 25 : width / 3.2, marginBottom: 15, borderWidth: 1, - borderColor: Colors.theme1[colorScheme].grayE3, + borderColor: Colors.theme1[theme].grayE3, }, tw("flex justify-between px-2 pt-2 rounded-md"), ]} @@ -186,7 +184,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { { style={[ tw("text-center ml-1"), { - color: Colors.theme1[colorScheme].gray20, + color: Colors.theme1[theme].gray20, fontFamily: "bold", fontSize: fontSize.xl2, }, @@ -217,7 +215,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { @@ -236,7 +234,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { width: mobile ? width / 2 - 25 : width / 3.2, marginBottom: 15, borderWidth: 1, - borderColor: Colors.theme1[colorScheme].grayE3, + borderColor: Colors.theme1[theme].grayE3, }, tw("flex justify-between px-2 pt-2 rounded-md"), ]} @@ -277,7 +275,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { { style={[ tw("text-center ml-1"), { - color: Colors.theme1[colorScheme].gray20, + color: Colors.theme1[theme].gray20, fontFamily: "bold", fontSize: fontSize.xl2, }, @@ -308,7 +306,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { @@ -348,6 +346,7 @@ const Main = ({ books, filterOptions, grades, mobile }) => { const mapStateToProps = (state) => ({ filterOptions: state.book.filterOptions, mobile: state.publicApi.mobile, + theme: state.publicApi.theme }); const mapDispatchToProps = {};