reza fixed compo colors before QR

master
Reza_ashrafi 2 years ago
parent c6567f7385
commit ead30e9ef1
  1. 11
      src/screens/Profile/components/List.js
  2. 34
      src/screens/Profile/components/ProfileAddress/index.js
  3. 18
      src/screens/Profile/components/ProfileBookmark/index.js
  4. 16
      src/screens/Profile/components/Trophy.js
  5. 15
      src/screens/Profile/components/User.js

@ -1,8 +1,6 @@
import { import {
View, View,
Text, Text,
Image,
Appearance,
Platform, Platform,
TouchableOpacity, TouchableOpacity,
Dimensions, Dimensions,
@ -20,11 +18,9 @@ import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors"; import Colors from "../../../constants/Colors";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const { height } = Dimensions.get("window");
const List = ({ mobile }) => { const List = ({ mobile, theme }) => {
const navigation = useNavigation(); const navigation = useNavigation();
const colorScheme = Appearance.getColorScheme();
const pages = [ const pages = [
{ {
@ -215,7 +211,7 @@ const List = ({ mobile }) => {
), ),
{ {
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3 + "aa", borderColor: Colors.theme1[theme].grayE3 + "aa",
}, },
]} ]}
onPress={() => page.onPress()} onPress={() => page.onPress()}
@ -227,7 +223,7 @@ const List = ({ mobile }) => {
fontFamily: "regular", fontFamily: "regular",
marginTop: 5, marginTop: 5,
marginRight: mobile ? 10 : 20, marginRight: mobile ? 10 : 20,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.tiny : fontSize.lg,
}} }}
> >
@ -252,6 +248,7 @@ const List = ({ mobile }) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
export default connect(mapStateToProps)(List); export default connect(mapStateToProps)(List);

@ -3,8 +3,6 @@ import {
Text, Text,
Pressable, Pressable,
TouchableOpacity, TouchableOpacity,
Appearance,
ActivityIndicator,
SafeAreaView, SafeAreaView,
ScrollView, ScrollView,
StyleSheet, StyleSheet,
@ -28,7 +26,6 @@ import tw from "tailwind-rn";
import Colors from "../../../../constants/Colors"; import Colors from "../../../../constants/Colors";
import fontSize from "../../../../constants/fontSize"; import fontSize from "../../../../constants/fontSize";
const { height, width } = Dimensions.get("window");
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const ProfileAddress = ({ const ProfileAddress = ({
@ -38,11 +35,9 @@ const ProfileAddress = ({
userId, userId,
userAddressId, userAddressId,
getFactorInfo, getFactorInfo,
loading,
closeBottomSheet,
mobile, mobile,
theme
}) => { }) => {
const colorScheme = Appearance.getColorScheme();
const navigation = useNavigation(); const navigation = useNavigation();
const [height, setHeight] = React.useState(Dimensions.get("window").height); const [height, setHeight] = React.useState(Dimensions.get("window").height);
const Location = ({ address, active }) => { const Location = ({ address, active }) => {
@ -52,13 +47,13 @@ const ProfileAddress = ({
{ {
backgroundColor: backgroundColor:
userAddressId === address?.id userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF + "0a" ? Colors.theme1[theme].greenCF + "0a"
: Colors.theme1[colorScheme].grayE3 + "44", : Colors.theme1[theme].grayE3 + "44",
borderWidth: 2, borderWidth: 2,
borderColor: borderColor:
userAddressId === address?.id userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF + "aa" ? Colors.theme1[theme].greenCF + "aa"
: Colors.theme1[colorScheme].grayE3, : Colors.theme1[theme].grayE3,
}, },
tw( tw(
`flex flex-row-reverse items-center w-full px-3 py-2 rounded-md mt-2` `flex flex-row-reverse items-center w-full px-3 py-2 rounded-md mt-2`
@ -80,7 +75,7 @@ const ProfileAddress = ({
style={{ style={{
fontSize: fontSize.base, fontSize: fontSize.base,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
}} }}
> >
آدرس انتخابی شما آدرس انتخابی شما
@ -89,7 +84,7 @@ const ProfileAddress = ({
style={{ style={{
fontSize: fontSize.xs, fontSize: fontSize.xs,
fontFamily: "regular", fontFamily: "regular",
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
marginRight: 10, marginRight: 10,
}} }}
> >
@ -164,7 +159,7 @@ const ProfileAddress = ({
{!active && ( {!active && (
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}> <Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}>
<G <G
fill={Colors.theme1[colorScheme].gray20} fill={Colors.theme1[theme].gray20}
data-name="vuesax/linear/more" data-name="vuesax/linear/more"
> >
<Path d="M10 19a2 2 0 1 0 2-2 2.006 2.006 0 0 0-2 2Z" /> <Path d="M10 19a2 2 0 1 0 2-2 2.006 2.006 0 0 0-2 2Z" />
@ -181,8 +176,8 @@ const ProfileAddress = ({
title={"مشاهده روی نقشه"} title={"مشاهده روی نقشه"}
backgroundColor={ backgroundColor={
active active
? Colors.theme1[colorScheme].greenCF ? Colors.theme1[theme].greenCF
: Colors.theme1[colorScheme].gray20 + "66" : Colors.theme1[theme].gray20 + "66"
} }
color={"white"} color={"white"}
border={{ color: "#196EC0", width: 0 }} border={{ color: "#196EC0", width: 0 }}
@ -245,8 +240,8 @@ const ProfileAddress = ({
<TouchableOpacity <TouchableOpacity
style={[ style={[
{ {
backgroundColor: Colors.theme1[colorScheme].greenCF + "05", backgroundColor: Colors.theme1[theme].greenCF + "05",
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
borderWidth: 1.5, borderWidth: 1.5,
}, },
tw( tw(
@ -259,7 +254,7 @@ const ProfileAddress = ({
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
color: Colors.theme1[colorScheme].greenCF, color: Colors.theme1[theme].greenCF,
}} }}
> >
یک آدرس جدید اضافه کنید یک آدرس جدید اضافه کنید
@ -269,7 +264,7 @@ const ProfileAddress = ({
marginTop: 3, marginTop: 3,
marginRight: 5, marginRight: 5,
fontSize: fontSize.xl3, fontSize: fontSize.xl3,
color: Colors.theme1[colorScheme].greenCF, color: Colors.theme1[theme].greenCF,
fontFamily: "bold", fontFamily: "bold",
}} }}
> >
@ -287,6 +282,7 @@ const mapStateToProps = (state) => ({
loading: state.userFactor.loading, loading: state.userFactor.loading,
addresses: state.userAddress.list, addresses: state.userAddress.list,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -37,8 +37,8 @@ const ProfileBookmark = ({
loading, loading,
mobile, mobile,
grades, grades,
theme
}) => { }) => {
const colorScheme = Appearance.getColorScheme();
React.useEffect(() => { React.useEffect(() => {
getList(); getList();
@ -71,7 +71,7 @@ const ProfileBookmark = ({
width: Dimensions.get("window").width, width: Dimensions.get("window").width,
height: height, height: height,
zIndex: 1, zIndex: 1,
backgroundColor: Colors.theme1[colorScheme].white + "60", backgroundColor: Colors.theme1[theme].white + "60",
}, },
]} ]}
> >
@ -92,6 +92,7 @@ const ProfileBookmark = ({
deleteItem={deleteItem} deleteItem={deleteItem}
mobile={mobile} mobile={mobile}
grades={grades} grades={grades}
theme={theme}
/> />
))} ))}
</View> </View>
@ -104,13 +105,9 @@ const ProfileBookmark = ({
); );
}; };
const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => { const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme }) => {
const navigation = useNavigation(); const navigation = useNavigation();
const colorScheme = React.useMemo(() => {
return Appearance.getColorScheme();
}, [bookmark]);
const isContent = React.useMemo(() => { const isContent = React.useMemo(() => {
return bookmark?.content; return bookmark?.content;
}, [bookmark]); }, [bookmark]);
@ -121,7 +118,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => {
tw("flex flex-row-reverse rounded-md justify-between px-3.5 py-2 mb-4"), tw("flex flex-row-reverse rounded-md justify-between px-3.5 py-2 mb-4"),
{ {
borderWidth: 1.5, borderWidth: 1.5,
borderColor: Colors.theme1[colorScheme].greenCF, borderColor: Colors.theme1[theme].greenCF,
}, },
]} ]}
onPress={() => onPress={() =>
@ -165,7 +162,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => {
style={{ style={{
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
width: width / 3, width: width / 3,
}} }}
> >
@ -177,7 +174,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades }) => {
marginTop: 5, marginTop: 5,
fontFamily: "regular", fontFamily: "regular",
fontSize: fontSize.base, fontSize: fontSize.base,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
}} }}
> >
{"پایه" + " " + grades[bookmark?.product?.book?.gradeId]} {"پایه" + " " + grades[bookmark?.product?.book?.gradeId]}
@ -217,6 +214,7 @@ const mapStateToProps = (state) => ({
bookmarkList: state.userFavorite.list, bookmarkList: state.userFavorite.list,
loading: state.userFavorite.loading, loading: state.userFavorite.loading,
grades: state.publicApi.grades, grades: state.publicApi.grades,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -1,4 +1,4 @@
import { View, Text, Appearance, Platform, Pressable } from "react-native"; import { View, Text, Platform, Pressable } from "react-native";
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import Svg, { G, Path } from "react-native-svg"; import Svg, { G, Path } from "react-native-svg";
@ -10,16 +10,14 @@ import Colors from "../../../constants/Colors";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const Trophy = ({}) => { const Trophy = ({theme}) => {
const colorScheme = Appearance.getColorScheme();
const [dropdown, setDropdown] = React.useState(true);
return ( return (
<View <View
style={[ style={[
tw( tw(
`w-full flex py-3 px-3 justify-between flex-row-reverse` `w-full flex py-3 px-3 justify-between flex-row-reverse`
), ),
{ backgroundColor: Colors.theme1[colorScheme].yellow2 }, { backgroundColor: Colors.theme1[theme].yellow2 },
]} ]}
> >
<View style={[tw(`flex flex-row-reverse`)]}> <View style={[tw(`flex flex-row-reverse`)]}>
@ -57,7 +55,7 @@ const Trophy = ({}) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
marginRight: 10, marginRight: 10,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
}} }}
> >
{"امتیاز شما" + " " + 14560} {"امتیاز شما" + " " + 14560}
@ -68,7 +66,7 @@ const Trophy = ({}) => {
style={{ style={{
fontFamily: "light", fontFamily: "light",
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
}} }}
> >
مشاهده جوایز مشاهده جوایز
@ -78,6 +76,8 @@ const Trophy = ({}) => {
); );
}; };
const mapStateToProps = (state) => ({}); const mapStateToProps = (state) => ({
theme: state.publicApi.theme
});
export default connect(mapStateToProps)(Trophy); export default connect(mapStateToProps)(Trophy);

@ -2,7 +2,6 @@ import {
View, View,
Text, Text,
Image, Image,
Appearance,
Platform, Platform,
Pressable, Pressable,
} from "react-native"; } from "react-native";
@ -17,8 +16,7 @@ import Colors from "../../../constants/Colors";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const User = ({ user, mobile }) => { const User = ({ user, mobile, theme }) => {
const colorScheme = Appearance.getColorScheme();
const [dropdown, setDropdown] = React.useState(true); const [dropdown, setDropdown] = React.useState(true);
return ( return (
<View style={tw(`w-full ${ios ? "items-end" : ""}`)}> <View style={tw(`w-full ${ios ? "items-end" : ""}`)}>
@ -54,7 +52,7 @@ const User = ({ user, mobile }) => {
<Text <Text
style={{ style={{
fontSize: mobile ? fontSize.lg : fontSize.xl5, fontSize: mobile ? fontSize.lg : fontSize.xl5,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
fontFamily: "bold", fontFamily: "bold",
}} }}
> >
@ -63,7 +61,7 @@ const User = ({ user, mobile }) => {
<Text <Text
style={{ style={{
fontSize: mobile ? fontSize.tiny : fontSize.xl2, fontSize: mobile ? fontSize.tiny : fontSize.xl2,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
fontFamily: "light", fontFamily: "light",
marginTop: mobile ? 3 : 6, marginTop: mobile ? 3 : 6,
}} }}
@ -98,7 +96,7 @@ const User = ({ user, mobile }) => {
tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse`), tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse`),
{ {
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[theme].grayE3,
}, },
]} ]}
> >
@ -106,7 +104,7 @@ const User = ({ user, mobile }) => {
style={{ style={{
fontSize: mobile ? fontSize.base : fontSize.xl, fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
}} }}
> >
افزودن حساب کاربری جدید افزودن حساب کاربری جدید
@ -117,7 +115,7 @@ const User = ({ user, mobile }) => {
marginTop: 3, marginTop: 3,
fontSize: fontSize.xl2, fontSize: fontSize.xl2,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
}} }}
> >
+ +
@ -132,6 +130,7 @@ const User = ({ user, mobile }) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
user: state.user.status, user: state.user.status,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
export default connect(mapStateToProps)(User); export default connect(mapStateToProps)(User);

Loading…
Cancel
Save