reza fixed compo colors before Products

master
Reza_ashrafi 3 years ago
parent 27220a735a
commit d800583931
  1. 76
      src/screens/Product/components/Book.js
  2. 10
      src/screens/Product/components/LinkBox.js
  3. 22
      src/screens/Product/components/Rates.js

@ -6,7 +6,6 @@ import {
ScrollView, ScrollView,
TouchableHighlight, TouchableHighlight,
Dimensions, Dimensions,
Appearance,
Platform, Platform,
} from "react-native"; } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
@ -44,8 +43,8 @@ function Book({
userFavoriteLoading, userFavoriteLoading,
mobile, mobile,
userProducts, userProducts,
theme
}) { }) {
const colorScheme = Appearance.getColorScheme();
const navigation = useNavigation(); const navigation = useNavigation();
const [type, setType] = useState(1); const [type, setType] = useState(1);
const [pageLoading, setPageLoading] = useState(false); const [pageLoading, setPageLoading] = useState(false);
@ -80,9 +79,9 @@ function Book({
tw("absolute left-0 top-0 rounded-md overflow-hidden"), tw("absolute left-0 top-0 rounded-md overflow-hidden"),
{ {
width: Dimensions.get("window").width, width: Dimensions.get("window").width,
height: height - 200, height: height - 110,
zIndex: 1, zIndex: 1,
backgroundColor: Colors.theme1[colorScheme].white + "60", backgroundColor: Colors.theme1[theme].white + "60",
}, },
]} ]}
> >
@ -111,7 +110,7 @@ function Book({
<View style={tw("flex items-end")}> <View style={tw("flex items-end")}>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
fontSize: mobile ? fontSize.base : fontSize.xl3, fontSize: mobile ? fontSize.base : fontSize.xl3,
marginBottom: 5, marginBottom: 5,
fontFamily: "bold", fontFamily: "bold",
@ -122,7 +121,7 @@ function Book({
</Text> </Text>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
fontSize: mobile ? fontSize.tiny : fontSize.xl, fontSize: mobile ? fontSize.tiny : fontSize.xl,
fontFamily: "regular", fontFamily: "regular",
}} }}
@ -146,7 +145,7 @@ function Book({
<View> <View>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
textAlign: "center", textAlign: "center",
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontFamily: "regular", fontFamily: "regular",
@ -158,7 +157,7 @@ function Book({
</View> </View>
<View <View
style={{ style={{
backgroundColor: Colors.theme1[colorScheme].green79 + "55", backgroundColor: Colors.theme1[theme].green79 + "55",
height: 20, height: 20,
width: 2, width: 2,
}} }}
@ -166,7 +165,7 @@ function Book({
<View> <View>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
textAlign: "center", textAlign: "center",
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontFamily: "regular", fontFamily: "regular",
@ -178,7 +177,7 @@ function Book({
</View> </View>
<View <View
style={{ style={{
backgroundColor: Colors.theme1[colorScheme].green79 + "55", backgroundColor: Colors.theme1[theme].green79 + "55",
height: 20, height: 20,
width: 2, width: 2,
}} }}
@ -186,7 +185,7 @@ function Book({
<View> <View>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
textAlign: "center", textAlign: "center",
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontFamily: "regular", fontFamily: "regular",
@ -202,7 +201,7 @@ function Book({
style={[ style={[
tw("w-full text-right"), tw("w-full text-right"),
{ {
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.tiny : fontSize.lg,
fontFamily: "demi", fontFamily: "demi",
}, },
@ -214,13 +213,13 @@ function Book({
</View> </View>
<View style={tw("flex flex-row-reverse justify-between flex-wrap py-3")}> <View style={tw("flex flex-row-reverse justify-between flex-wrap py-3")}>
<TouchableHighlight <TouchableHighlight
underlayColor={Colors.theme1[colorScheme].greenFF + "22"} underlayColor={Colors.theme1[theme].greenFF + "22"}
style={[ style={[
tw("flex flex-row-reverse w-full justify-between px-2 py-3 mb-4"), tw("flex flex-row-reverse w-full justify-between px-2 py-3 mb-4"),
{ {
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a", backgroundColor: Colors.theme1[theme].greenFF + "0a",
}, },
]} ]}
onPress={() => onPress={() =>
@ -244,7 +243,7 @@ function Book({
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
paddingVertical: 4, paddingVertical: 4,
}} }}
> >
@ -258,7 +257,7 @@ function Book({
tw("py-1 pr-2"), tw("py-1 pr-2"),
{ {
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
fontSize: fontSize.sm, fontSize: fontSize.sm,
}, },
]} ]}
@ -270,13 +269,13 @@ function Book({
</> </>
</TouchableHighlight> </TouchableHighlight>
<TouchableHighlight <TouchableHighlight
underlayColor={Colors.theme1[colorScheme].greenFF + "22"} underlayColor={Colors.theme1[theme].greenFF + "22"}
style={[ style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"), tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{ {
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a", backgroundColor: Colors.theme1[theme].greenFF + "0a",
width: width - 32 - 8 - (fontSize.sm * 6 + 18), width: width - 32 - 8 - (fontSize.sm * 6 + 18),
}, },
]} ]}
@ -301,7 +300,7 @@ function Book({
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
paddingVertical: 4, paddingVertical: 4,
}} }}
> >
@ -313,9 +312,9 @@ function Book({
tw("py-1 pr-2"), tw("py-1 pr-2"),
{ {
borderRightWidth: 1, borderRightWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
fontSize: fontSize.sm, fontSize: fontSize.sm,
}, },
]} ]}
@ -326,13 +325,13 @@ function Book({
</> </>
</TouchableHighlight> </TouchableHighlight>
<TouchableHighlight <TouchableHighlight
underlayColor={Colors.theme1[colorScheme].greenFF + "22"} underlayColor={Colors.theme1[theme].greenFF + "22"}
style={[ style={[
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"), tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{ {
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a", backgroundColor: Colors.theme1[theme].greenFF + "0a",
width: fontSize.sm * 6 + 18, width: fontSize.sm * 6 + 18,
}, },
]} ]}
@ -341,8 +340,8 @@ function Book({
<Text <Text
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.sm, fontSize: fontSize.xs,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
paddingVertical: 4, paddingVertical: 4,
}} }}
> >
@ -350,13 +349,13 @@ function Book({
</Text> </Text>
</TouchableHighlight> </TouchableHighlight>
<TouchableHighlight <TouchableHighlight
underlayColor={Colors.theme1[colorScheme].greenFF + "22"} underlayColor={Colors.theme1[theme].greenFF + "22"}
style={[ style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"), tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{ {
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a", backgroundColor: Colors.theme1[theme].greenFF + "0a",
width: width - 32 - 8 - (fontSize.sm * 6 + 18), width: width - 32 - 8 - (fontSize.sm * 6 + 18),
}, },
]} ]}
@ -373,7 +372,7 @@ function Book({
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
paddingVertical: 4, paddingVertical: 4,
}} }}
> >
@ -386,7 +385,7 @@ function Book({
tw("py-1 pr-2"), tw("py-1 pr-2"),
{ {
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
fontSize: fontSize.sm, fontSize: fontSize.sm,
}, },
]} ]}
@ -397,13 +396,13 @@ function Book({
</> </>
</TouchableHighlight> </TouchableHighlight>
<TouchableHighlight <TouchableHighlight
underlayColor={Colors.theme1[colorScheme].greenFF + "22"} underlayColor={Colors.theme1[theme].greenFF + "22"}
style={[ style={[
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"), tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{ {
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a", backgroundColor: Colors.theme1[theme].greenFF + "0a",
width: fontSize.sm * 6 + 18, width: fontSize.sm * 6 + 18,
}, },
]} ]}
@ -412,8 +411,8 @@ function Book({
<Text <Text
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.sm, fontSize: fontSize.xs,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
paddingVertical: 4, paddingVertical: 4,
}} }}
> >
@ -479,6 +478,7 @@ const mapStateToProps = (state) => ({
userProductsLoading: state.userProduct.loading, userProductsLoading: state.userProduct.loading,
userFavoriteLoading: state.userFavorite.loading, userFavoriteLoading: state.userFavorite.loading,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -9,8 +9,7 @@ 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";
function Description({ title, component, height, mobile }) { function Description({ title, component, height, mobile, theme }) {
const colorScheme = Appearance.getColorScheme();
const refRBSheet = useRef(); const refRBSheet = useRef();
return ( return (
<> <>
@ -21,7 +20,7 @@ function Description({ title, component, height, mobile }) {
`flex flex-row-reverse justify-between items-center mt-3 rounded-sm px-5 ${mobile ? "py-4" : "py-4"}` `flex flex-row-reverse justify-between items-center mt-3 rounded-sm px-5 ${mobile ? "py-4" : "py-4"}`
), ),
{ {
backgroundColor: Colors.theme1[colorScheme].greenCF + '15', backgroundColor: Colors.theme1[theme].greenCF + '15',
// borderWidth : 1, // borderWidth : 1,
}, },
]} ]}
@ -30,7 +29,7 @@ function Description({ title, component, height, mobile }) {
style={[ style={[
{ {
fontSize: mobile ? fontSize.sm : fontSize.lg, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
fontFamily: "demi", fontFamily: "demi",
}, },
tw(""), tw(""),
@ -38,7 +37,7 @@ function Description({ title, component, height, mobile }) {
> >
{title} {title}
</Text> </Text>
<Entypo name="chevron-small-left" size={20} color={Colors.theme1[colorScheme].green79} /> <Entypo name="chevron-small-left" size={20} color={Colors.theme1[theme].green79} />
</TouchableOpacity> </TouchableOpacity>
<RBSheet <RBSheet
ref={refRBSheet} ref={refRBSheet}
@ -68,6 +67,7 @@ function Description({ title, component, height, mobile }) {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
export default connect(mapStateToProps)(Description); export default connect(mapStateToProps)(Description);

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import { View, Text, Dimensions, Appearance, Pressable } from "react-native"; import { View, Text, Dimensions, Pressable } from "react-native";
import { Rating } from "react-native-ratings"; import { Rating } from "react-native-ratings";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { vote } from "../../../redux/actions"; import { vote } from "../../../redux/actions";
@ -12,10 +12,7 @@ import Colors from "../../../constants/Colors";
const width = Dimensions.get("window").width; const width = Dimensions.get("window").width;
function Rates({ rate, productId, addVote, isBuyed = null }) { function Rates({ rate, productId, addVote, isBuyed = null, theme }) {
const ratingCompleted = (rating) => {
return;
};
return ( return (
<View style={tw("flex flex-row-reverse")}> <View style={tw("flex flex-row-reverse")}>
@ -63,17 +60,14 @@ function Rates({ rate, productId, addVote, isBuyed = null }) {
{ name: "بخش ۱", value: 10 }, { name: "بخش ۱", value: 10 },
{ name: "بخش ۱", value: 50 }, { name: "بخش ۱", value: 50 },
].map((field, index) => ( ].map((field, index) => (
<Progress key={index} data={field} /> <Progress key={index} data={field} theme={theme} />
))} ))}
</View> </View>
</View> </View>
); );
} }
const Progress = ({ data, ...props }) => { const Progress = ({ data,theme, ...props }) => {
const colorScheme = React.useMemo(() => {
return Appearance.getColorScheme();
}, [props.useless]);
return ( return (
<View style={[tw("flex flex-1 flex-row items-center py-1.5")]}> <View style={[tw("flex flex-1 flex-row items-center py-1.5")]}>
@ -89,7 +83,7 @@ const Progress = ({ data, ...props }) => {
<View <View
style={[ style={[
tw("rounded-md ml-2 flex-1"), tw("rounded-md ml-2 flex-1"),
{ height: 6, backgroundColor: Colors.theme1[colorScheme].greenFF1 }, { height: 6, backgroundColor: Colors.theme1[theme].greenFF1 },
]} ]}
> >
<View <View
@ -97,7 +91,7 @@ const Progress = ({ data, ...props }) => {
tw("h-full rounded-md"), tw("h-full rounded-md"),
{ {
width: data.value + "%", width: data.value + "%",
backgroundColor: Colors.theme1[colorScheme].greenCF, backgroundColor: Colors.theme1[theme].greenCF,
}, },
]} ]}
></View> ></View>
@ -117,7 +111,9 @@ const Progress = ({ data, ...props }) => {
); );
}; };
const mapStateToProps = (state) => ({}); const mapStateToProps = (state) => ({
theme: state.publicApi.theme
});
const mapDispatchToProps = { const mapDispatchToProps = {
addVote: vote.add, addVote: vote.add,

Loading…
Cancel
Save