reza fixed compo colors before Faq

master
Reza_ashrafi 2 years ago
parent be6d9c264a
commit 4ca5b990c8
  1. 31
      src/screens/DeliveryForm/Address/index.js
  2. 26
      src/screens/DeliveryForm/TransportDate/index.js
  3. 28
      src/screens/DeliveryForm/TransportMethod/index.js
  4. 13
      src/screens/DeliveryForm/index.js

@ -3,7 +3,6 @@ import {
Text, Text,
Pressable, Pressable,
TouchableOpacity, TouchableOpacity,
Appearance,
ActivityIndicator, ActivityIndicator,
Platform Platform
} from "react-native"; } from "react-native";
@ -19,8 +18,7 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const Address = ({ addresses, update, userId, userAddressId, loading, mobile }) => { const Address = ({ addresses, update, userId, userAddressId, loading, mobile, theme }) => {
const colorScheme = Appearance.getColorScheme();
const navigation = useNavigation(); const navigation = useNavigation();
const Location = ({ address, active }) => { const Location = ({ address, active }) => {
@ -30,13 +28,13 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
{ {
backgroundColor: backgroundColor:
userAddressId === address?.id userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF + "15" ? Colors.theme1[theme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44", : Colors.theme1[theme].grayE3 + "44",
borderWidth: 1.5, borderWidth: 1.5,
borderColor: borderColor:
userAddressId === address?.id userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF ? Colors.theme1[theme].greenCF
: Colors.theme1[colorScheme].grayE3, : Colors.theme1[theme].grayE3,
}, },
tw( tw(
`flex flex-row-reverse items-center w-full px-3 rounded-sm mt-2 ${mobile ? "py-2" : "py-4"}` `flex flex-row-reverse items-center w-full px-3 rounded-sm mt-2 ${mobile ? "py-2" : "py-4"}`
@ -51,7 +49,7 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
{loading && userAddressId !== address?.id ? ( {loading && userAddressId !== address?.id ? (
<ActivityIndicator <ActivityIndicator
size="small" size="small"
color={Colors.theme1[colorScheme].greenC8} color={Colors.theme1[theme].greenC8}
/> />
) : ( ) : (
<View <View
@ -59,13 +57,13 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
tw("w-5 h-5 rounded-full"), tw("w-5 h-5 rounded-full"),
{ {
backgroundColor: active backgroundColor: active
? Colors.theme1[colorScheme].greenCF ? Colors.theme1[theme].greenCF
: "white", : "white",
borderWidth: userAddressId === address?.id ? 4 : 1, borderWidth: userAddressId === address?.id ? 4 : 1,
borderColor: borderColor:
userAddressId === address?.id userAddressId === address?.id
? Colors.theme1[colorScheme].black ? Colors.theme1[theme].black
: Colors.theme1[colorScheme].gray20 + "33", : Colors.theme1[theme].gray20 + "33",
}, },
]} ]}
></View> ></View>
@ -102,8 +100,8 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
<TouchableOpacity <TouchableOpacity
style={[ style={[
{ {
backgroundColor: Colors.theme1[colorScheme].grayE3 + "44", backgroundColor: Colors.theme1[theme].grayE3 + "44",
borderColor: Colors.theme1[colorScheme].gray2077 + '55', borderColor: Colors.theme1[theme].gray2077 + '55',
borderWidth: 1.5, borderWidth: 1.5,
}, },
tw( tw(
@ -116,7 +114,7 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
style={{ style={{
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.lg, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].gray2077, color: Colors.theme1[theme].gray2077,
}} }}
> >
یک آدرس جدید اضافه کنید یک آدرس جدید اضافه کنید
@ -125,7 +123,7 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
style={{ style={{
marginRight: 5, marginRight: 5,
fontSize: mobile ? fontSize.xl : fontSize.xl4, fontSize: mobile ? fontSize.xl : fontSize.xl4,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[theme].gray20,
}} }}
> >
+ +
@ -139,7 +137,8 @@ const mapStateToProps = (state) => ({
userId: state.user.status?.id, userId: state.user.status?.id,
userAddressId: state.userFactor.info?.userAddressId, userAddressId: state.userFactor.info?.userAddressId,
loading: state.userFactor.loading, loading: state.userFactor.loading,
mobile: state.publicApi.mobile mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -1,4 +1,4 @@
import { View, Text, Pressable, Appearance, Platform } from "react-native"; import { View, Text, Pressable, Platform } from "react-native";
import React, { useCallback, useState } from "react"; import React, { useCallback, useState } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
@ -9,8 +9,7 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const TransportDate = ({ transportDate, mobile }) => { const TransportDate = ({ transportDate, mobile, theme }) => {
const colorScheme = Appearance.getColorScheme();
const [activeDate, setActiveDate] = useState(transportDate?.times[0]); const [activeDate, setActiveDate] = useState(transportDate?.times[0]);
const Time = useCallback(({ time, active }) => { const Time = useCallback(({ time, active }) => {
@ -20,12 +19,12 @@ const TransportDate = ({ transportDate, mobile }) => {
tw(`flex flex-row-reverse justify-between items-center w-full px-3 ${mobile ? "py-3" : "py-2"} rounded-sm mt-3`), tw(`flex flex-row-reverse justify-between items-center w-full px-3 ${mobile ? "py-3" : "py-2"} rounded-sm mt-3`),
{ {
backgroundColor: active backgroundColor: active
? Colors.theme1[colorScheme].greenCF + "15" ? Colors.theme1[theme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44", : Colors.theme1[theme].grayE3 + "44",
borderWidth: 1.5, borderWidth: 1.5,
borderColor: active borderColor: active
? Colors.theme1[colorScheme].greenCF ? Colors.theme1[theme].greenCF
: Colors.theme1[colorScheme].grayE3, : Colors.theme1[theme].grayE3,
}, },
]} ]}
onPress={() => setActiveDate(time)} onPress={() => setActiveDate(time)}
@ -35,8 +34,8 @@ const TransportDate = ({ transportDate, mobile }) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.xl, fontSize: mobile ? fontSize.tiny : fontSize.xl,
color: active color: active
? Colors.theme1[colorScheme].gray20 ? Colors.theme1[theme].gray20
: Colors.theme1[colorScheme].gray20, : Colors.theme1[theme].gray20,
}} }}
> >
{time.time} {time.time}
@ -58,8 +57,8 @@ const TransportDate = ({ transportDate, mobile }) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.base, fontSize: mobile ? fontSize.sm : fontSize.base,
color: active color: active
? Colors.theme1[colorScheme].green20 ? Colors.theme1[theme].green20
: Colors.theme1[colorScheme].gray20, : Colors.theme1[theme].gray20,
}} }}
> >
تکمیل ظرفیت تکمیل ظرفیت
@ -74,7 +73,7 @@ const TransportDate = ({ transportDate, mobile }) => {
style={{ style={{
fontSize: mobile ? fontSize.base : fontSize.xl2, fontSize: mobile ? fontSize.base : fontSize.xl2,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
textAlign : ios ? "right" : "auto", textAlign : ios ? "right" : "auto",
}} }}
> >
@ -90,7 +89,8 @@ const TransportDate = ({ transportDate, mobile }) => {
}; };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = {}; const mapDispatchToProps = {};

@ -2,14 +2,11 @@ import {
View, View,
Text, Text,
Pressable, Pressable,
TouchableOpacity,
Appearance,
ActivityIndicator, ActivityIndicator,
Platform, Platform,
} from "react-native"; } from "react-native";
import React, { useEffect, useCallback } from "react"; import React, { useEffect, useCallback } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { useNavigation } from "@react-navigation/native";
import { transport } from "../../../redux/actions"; import { transport } from "../../../redux/actions";
import separate from "../../../utils/separate"; import separate from "../../../utils/separate";
@ -28,8 +25,8 @@ const TransportMethod = ({
userId, userId,
loading, loading,
mobile, mobile,
theme
}) => { }) => {
const colorScheme = Appearance.getColorScheme();
useEffect(() => { useEffect(() => {
getList(); getList();
@ -47,12 +44,12 @@ const TransportMethod = ({
), ),
{ {
backgroundColor: active backgroundColor: active
? Colors.theme1[colorScheme].greenCF + "15" ? Colors.theme1[theme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44", : Colors.theme1[theme].grayE3 + "44",
borderWidth: 1.5, borderWidth: 1.5,
borderColor: active borderColor: active
? Colors.theme1[colorScheme].greenCF ? Colors.theme1[theme].greenCF
: Colors.theme1[colorScheme].grayE3, : Colors.theme1[theme].grayE3,
}, },
]} ]}
onPress={() => onPress={() =>
@ -70,8 +67,8 @@ const TransportMethod = ({
size="small" size="small"
color={ color={
factorInfo?.transportId === method?.id factorInfo?.transportId === method?.id
? Colors.theme1[colorScheme].greenC8 ? Colors.theme1[theme].greenC8
: Colors.theme1[colorScheme].gray20 : Colors.theme1[theme].gray20
} }
/> />
) : ( ) : (
@ -80,8 +77,8 @@ const TransportMethod = ({
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.xl2, fontSize: mobile ? fontSize.tiny : fontSize.xl2,
color: active color: active
? Colors.theme1[colorScheme].gray20 ? Colors.theme1[theme].gray20
: Colors.theme1[colorScheme].gray20, : Colors.theme1[theme].gray20,
}} }}
> >
{method.name} {method.name}
@ -103,8 +100,8 @@ const TransportMethod = ({
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.base : fontSize.base, fontSize: mobile ? fontSize.base : fontSize.base,
color: active color: active
? Colors.theme1[colorScheme].green20 ? Colors.theme1[theme].green20
: Colors.theme1[colorScheme].gray20, : Colors.theme1[theme].gray20,
}} }}
> >
{separate(method.price) + " " + "تومان"} {separate(method.price) + " " + "تومان"}
@ -121,7 +118,7 @@ const TransportMethod = ({
style={{ style={{
fontSize: mobile ? fontSize.base : fontSize.xl, fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[theme].green79,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}} }}
> >
@ -146,6 +143,7 @@ const mapStateToProps = (state) => ({
userId: state.user.status?.id, userId: state.user.status?.id,
loading: state.userFactor.loading, loading: state.userFactor.loading,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -1,18 +1,14 @@
import { import {
View, View,
Text,
SafeAreaView, SafeAreaView,
ScrollView, ScrollView,
StyleSheet, StyleSheet,
StatusBar, StatusBar,
Platform, Platform,
Dimensions,
Appearance,
} from "react-native"; } from "react-native";
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userFactor, userAddress } from "../../redux/actions"; import { userFactor, userAddress } from "../../redux/actions";
import { useNavigation } from "@react-navigation/native";
import { asyncAwesomeAlert } from "../../utils/AsyncWrappers"; import { asyncAwesomeAlert } from "../../utils/AsyncWrappers";
//components //components
@ -26,12 +22,8 @@ import CustomPressable from "../../components/Pressable";
//style //style
import tw from "tailwind-rn"; import tw from "tailwind-rn";
import Colors from "../../constants/Colors"; import Colors from "../../constants/Colors";
import fontSize from "../../constants/fontSize";
const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, factorInfo }) => {
const colorScheme = Appearance.getColorScheme();
const navigation = useNavigation();
const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, factorInfo, theme }) => {
useEffect(() => { useEffect(() => {
getFactorInfo({ userId }); getFactorInfo({ userId });
getList(); getList();
@ -71,7 +63,7 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f
</View> </View>
<CustomPressable <CustomPressable
title={"ادامه فرایند خرید"} title={"ادامه فرایند خرید"}
backgroundColor={Colors.theme1[colorScheme].greenCF} backgroundColor={Colors.theme1[theme].greenCF}
color={"white"} color={"white"}
border={{ color: "#196EC0", width: 0 }} border={{ color: "#196EC0", width: 0 }}
width={"100%"} width={"100%"}
@ -105,6 +97,7 @@ const mapStateToProps = (state) => ({
factorInfo: state.userFactor.info, factorInfo: state.userFactor.info,
userId: state.user.status?.id, userId: state.user.status?.id,
list: state.userAddress.list, list: state.userAddress.list,
theme: state.publicApi.theme
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

Loading…
Cancel
Save