diff --git a/src/screens/DeliveryForm/Address/index.js b/src/screens/DeliveryForm/Address/index.js index ee3e0d6..cc73ebe 100644 --- a/src/screens/DeliveryForm/Address/index.js +++ b/src/screens/DeliveryForm/Address/index.js @@ -98,6 +98,10 @@ const Address = ({ ); }; + const light = React.useMemo(() => { + return theme === 'light'; + },[theme]); + return ( @@ -112,8 +116,8 @@ const Address = ({ یک آدرس جدید اضافه کنید @@ -135,7 +139,7 @@ const Address = ({ style={{ marginRight: 5, fontSize: mobile ? fontSize.xl : fontSize.xl4, - color: Colors.theme1.gray20, + color: light ? Colors.theme1.gray2077 : Colors.theme1.grayE3, }} > + diff --git a/src/screens/DeliveryForm/TransportDate/index.js b/src/screens/DeliveryForm/TransportDate/index.js index 1ec1b69..d834dc0 100644 --- a/src/screens/DeliveryForm/TransportDate/index.js +++ b/src/screens/DeliveryForm/TransportDate/index.js @@ -12,15 +12,19 @@ const ios = Platform.OS === "ios"; const TransportDate = ({ transportDate, mobile, theme }) => { const [activeDate, setActiveDate] = useState(transportDate?.times[0]); + const light = React.useMemo(() => { + return theme === "light"; + }, [theme]); + const Time = useCallback(({ time, active }) => { return ( { fontFamily: "regular", fontSize: mobile ? fontSize.tiny : fontSize.xl, color: active - ? Colors.theme1.gray20 - : Colors.theme1.gray20, + ? light ? Colors.theme1.gray20 : Colors.theme1.greenCF + : light ? Colors.theme1.gray20 : Colors.theme1.white, }} > {time.time} @@ -57,8 +61,8 @@ const TransportDate = ({ transportDate, mobile, theme }) => { fontFamily: "regular", fontSize: mobile ? fontSize.sm : fontSize.base, color: active - ? Colors.theme1.green20 - : Colors.theme1.gray20, + ? light ? Colors.theme1.green20 : Colors.theme1.greenCF + : light ? Colors.theme1.gray20 : Colors.theme1.white, }} > تکمیل ظرفیت @@ -67,13 +71,14 @@ const TransportDate = ({ transportDate, mobile, theme }) => { ); }, []); + return ( diff --git a/src/screens/DeliveryForm/TransportMethod/index.js b/src/screens/DeliveryForm/TransportMethod/index.js index 2ca4298..bdc5bea 100644 --- a/src/screens/DeliveryForm/TransportMethod/index.js +++ b/src/screens/DeliveryForm/TransportMethod/index.js @@ -25,13 +25,16 @@ const TransportMethod = ({ userId, loading, mobile, - theme + theme, }) => { - useEffect(() => { getList(); }, []); + const light = React.useMemo(() => { + return theme === "light"; + }, [theme]); + const Method = useCallback( ({ method, active }) => { return ( @@ -43,9 +46,9 @@ const TransportMethod = ({ }` ), { - backgroundColor: active + backgroundColor: light ? active ? Colors.theme1.greenCF + "15" - : Colors.theme1.grayE3 + "44", + : Colors.theme1.grayE3 + "44" : null, borderWidth: 1.5, borderColor: active ? Colors.theme1.greenCF @@ -77,8 +80,12 @@ const TransportMethod = ({ fontFamily: "regular", fontSize: mobile ? fontSize.tiny : fontSize.xl2, color: active + ? light + ? Colors.theme1.gray20 + : Colors.theme1.greenCF + : light ? Colors.theme1.gray20 - : Colors.theme1.gray20, + : Colors.theme1.white, }} > {method.name} @@ -87,7 +94,11 @@ const TransportMethod = ({ {separate(method.price) + " " + "تومان"} @@ -118,7 +133,7 @@ const TransportMethod = ({ style={{ fontSize: mobile ? fontSize.base : fontSize.xl, fontFamily: "bold", - color: Colors.theme1.green79, + color: light ? Colors.theme1.green79 : Colors.theme1.white, textAlign: ios ? "right" : "auto", }} > @@ -143,7 +158,7 @@ const mapStateToProps = (state) => ({ userId: state.user.status?.id, loading: state.userFactor.loading, mobile: state.publicApi.mobile, - theme: state.publicApi.theme + theme: state.publicApi.theme, }); const mapDispatchToProps = { diff --git a/src/screens/DeliveryForm/index.js b/src/screens/DeliveryForm/index.js index 78bffcd..e8f080e 100644 --- a/src/screens/DeliveryForm/index.js +++ b/src/screens/DeliveryForm/index.js @@ -86,7 +86,6 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16,