reza fixed compo colors before Faq

master
Reza_ashrafi 3 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,
Pressable,
TouchableOpacity,
Appearance,
ActivityIndicator,
Platform
} from "react-native";
@ -19,8 +18,7 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios";
const Address = ({ addresses, update, userId, userAddressId, loading, mobile }) => {
const colorScheme = Appearance.getColorScheme();
const Address = ({ addresses, update, userId, userAddressId, loading, mobile, theme }) => {
const navigation = useNavigation();
const Location = ({ address, active }) => {
@ -30,13 +28,13 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
{
backgroundColor:
userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44",
? Colors.theme1[theme].greenCF + "15"
: Colors.theme1[theme].grayE3 + "44",
borderWidth: 1.5,
borderColor:
userAddressId === address?.id
? Colors.theme1[colorScheme].greenCF
: Colors.theme1[colorScheme].grayE3,
? Colors.theme1[theme].greenCF
: Colors.theme1[theme].grayE3,
},
tw(
`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 ? (
<ActivityIndicator
size="small"
color={Colors.theme1[colorScheme].greenC8}
color={Colors.theme1[theme].greenC8}
/>
) : (
<View
@ -59,13 +57,13 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
tw("w-5 h-5 rounded-full"),
{
backgroundColor: active
? Colors.theme1[colorScheme].greenCF
? Colors.theme1[theme].greenCF
: "white",
borderWidth: userAddressId === address?.id ? 4 : 1,
borderColor:
userAddressId === address?.id
? Colors.theme1[colorScheme].black
: Colors.theme1[colorScheme].gray20 + "33",
? Colors.theme1[theme].black
: Colors.theme1[theme].gray20 + "33",
},
]}
></View>
@ -102,8 +100,8 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
<TouchableOpacity
style={[
{
backgroundColor: Colors.theme1[colorScheme].grayE3 + "44",
borderColor: Colors.theme1[colorScheme].gray2077 + '55',
backgroundColor: Colors.theme1[theme].grayE3 + "44",
borderColor: Colors.theme1[theme].gray2077 + '55',
borderWidth: 1.5,
},
tw(
@ -116,7 +114,7 @@ const Address = ({ addresses, update, userId, userAddressId, loading, mobile })
style={{
fontFamily: "regular",
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={{
marginRight: 5,
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,
userAddressId: state.userFactor.info?.userAddressId,
loading: state.userFactor.loading,
mobile: state.publicApi.mobile
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
});
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 { connect } from "react-redux";
@ -9,8 +9,7 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios";
const TransportDate = ({ transportDate, mobile }) => {
const colorScheme = Appearance.getColorScheme();
const TransportDate = ({ transportDate, mobile, theme }) => {
const [activeDate, setActiveDate] = useState(transportDate?.times[0]);
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`),
{
backgroundColor: active
? Colors.theme1[colorScheme].greenCF + "15"
: Colors.theme1[colorScheme].grayE3 + "44",
? Colors.theme1[theme].greenCF + "15"
: Colors.theme1[theme].grayE3 + "44",
borderWidth: 1.5,
borderColor: active
? Colors.theme1[colorScheme].greenCF
: Colors.theme1[colorScheme].grayE3,
? Colors.theme1[theme].greenCF
: Colors.theme1[theme].grayE3,
},
]}
onPress={() => setActiveDate(time)}
@ -35,8 +34,8 @@ const TransportDate = ({ transportDate, mobile }) => {
fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.xl,
color: active
? Colors.theme1[colorScheme].gray20
: Colors.theme1[colorScheme].gray20,
? Colors.theme1[theme].gray20
: Colors.theme1[theme].gray20,
}}
>
{time.time}
@ -58,8 +57,8 @@ const TransportDate = ({ transportDate, mobile }) => {
fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.base,
color: active
? Colors.theme1[colorScheme].green20
: Colors.theme1[colorScheme].gray20,
? Colors.theme1[theme].green20
: Colors.theme1[theme].gray20,
}}
>
تکمیل ظرفیت
@ -74,7 +73,7 @@ const TransportDate = ({ transportDate, mobile }) => {
style={{
fontSize: mobile ? fontSize.base : fontSize.xl2,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
color: Colors.theme1[theme].green79,
textAlign : ios ? "right" : "auto",
}}
>
@ -90,7 +89,8 @@ const TransportDate = ({ transportDate, mobile }) => {
};
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile
mobile: state.publicApi.mobile,
theme: state.publicApi.theme
});
const mapDispatchToProps = {};

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

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

Loading…
Cancel
Save