reza fixed delivery form

master
Reza_ashrafi 3 years ago
parent adb60ab715
commit 2e578ea1ec
  1. 12
      src/screens/DeliveryForm/Address/index.js
  2. 19
      src/screens/DeliveryForm/TransportDate/index.js
  3. 35
      src/screens/DeliveryForm/TransportMethod/index.js
  4. 1
      src/screens/DeliveryForm/index.js

@ -98,6 +98,10 @@ const Address = ({
); );
}; };
const light = React.useMemo(() => {
return theme === 'light';
},[theme]);
return ( return (
<View style={tw("w-full mt-2")}> <View style={tw("w-full mt-2")}>
<View style={tw("p-0 m-0 flex ")}> <View style={tw("p-0 m-0 flex ")}>
@ -112,8 +116,8 @@ const Address = ({
<TouchableOpacity <TouchableOpacity
style={[ style={[
{ {
backgroundColor: Colors.theme1.grayE3 + "44", backgroundColor: light ? Colors.theme1.grayE3 + "44" : null,
borderColor: Colors.theme1.gray2077 + "55", borderColor: light ? Colors.theme1.gray2077 + "55" : Colors.theme1.grayE3,
borderWidth: 1.5, borderWidth: 1.5,
}, },
tw( tw(
@ -126,7 +130,7 @@ const Address = ({
style={{ style={{
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.lg, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1.gray2077, color: light ? Colors.theme1.gray2077 : Colors.theme1.grayE3,
}} }}
> >
یک آدرس جدید اضافه کنید یک آدرس جدید اضافه کنید
@ -135,7 +139,7 @@ const Address = ({
style={{ style={{
marginRight: 5, marginRight: 5,
fontSize: mobile ? fontSize.xl : fontSize.xl4, fontSize: mobile ? fontSize.xl : fontSize.xl4,
color: Colors.theme1.gray20, color: light ? Colors.theme1.gray2077 : Colors.theme1.grayE3,
}} }}
> >
+ +

@ -12,15 +12,19 @@ const ios = Platform.OS === "ios";
const TransportDate = ({ transportDate, mobile, theme }) => { const TransportDate = ({ transportDate, mobile, theme }) => {
const [activeDate, setActiveDate] = useState(transportDate?.times[0]); const [activeDate, setActiveDate] = useState(transportDate?.times[0]);
const light = React.useMemo(() => {
return theme === "light";
}, [theme]);
const Time = useCallback(({ time, active }) => { const Time = useCallback(({ time, active }) => {
return ( return (
<Pressable <Pressable
style={[ style={[
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: light ? active
? Colors.theme1.greenCF + "15" ? Colors.theme1.greenCF + "15"
: Colors.theme1.grayE3 + "44", : Colors.theme1.grayE3 + "44" : null,
borderWidth: 1.5, borderWidth: 1.5,
borderColor: active borderColor: active
? Colors.theme1.greenCF ? Colors.theme1.greenCF
@ -34,8 +38,8 @@ const TransportDate = ({ transportDate, mobile, theme }) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.xl, fontSize: mobile ? fontSize.tiny : fontSize.xl,
color: active color: active
? Colors.theme1.gray20 ? light ? Colors.theme1.gray20 : Colors.theme1.greenCF
: Colors.theme1.gray20, : light ? Colors.theme1.gray20 : Colors.theme1.white,
}} }}
> >
{time.time} {time.time}
@ -57,8 +61,8 @@ const TransportDate = ({ transportDate, mobile, theme }) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.sm : fontSize.base, fontSize: mobile ? fontSize.sm : fontSize.base,
color: active color: active
? Colors.theme1.green20 ? light ? Colors.theme1.green20 : Colors.theme1.greenCF
: Colors.theme1.gray20, : light ? Colors.theme1.gray20 : Colors.theme1.white,
}} }}
> >
تکمیل ظرفیت تکمیل ظرفیت
@ -67,13 +71,14 @@ const TransportDate = ({ transportDate, mobile, theme }) => {
</Pressable> </Pressable>
); );
}, []); }, []);
return ( return (
<View style={tw(`w-full ${mobile ? "mt-4" : "mt-4"}`)}> <View style={tw(`w-full ${mobile ? "mt-4" : "mt-4"}`)}>
<Text <Text
style={{ style={{
fontSize: mobile ? fontSize.base : fontSize.xl2, fontSize: mobile ? fontSize.base : fontSize.xl2,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1.green79, color: light ? Colors.theme1.green79 : Colors.theme1.white,
textAlign : ios ? "right" : "auto", textAlign : ios ? "right" : "auto",
}} }}
> >

@ -25,13 +25,16 @@ const TransportMethod = ({
userId, userId,
loading, loading,
mobile, mobile,
theme theme,
}) => { }) => {
useEffect(() => { useEffect(() => {
getList(); getList();
}, []); }, []);
const light = React.useMemo(() => {
return theme === "light";
}, [theme]);
const Method = useCallback( const Method = useCallback(
({ method, active }) => { ({ method, active }) => {
return ( return (
@ -43,9 +46,9 @@ const TransportMethod = ({
}` }`
), ),
{ {
backgroundColor: active backgroundColor: light ? active
? Colors.theme1.greenCF + "15" ? Colors.theme1.greenCF + "15"
: Colors.theme1.grayE3 + "44", : Colors.theme1.grayE3 + "44" : null,
borderWidth: 1.5, borderWidth: 1.5,
borderColor: active borderColor: active
? Colors.theme1.greenCF ? Colors.theme1.greenCF
@ -77,8 +80,12 @@ const TransportMethod = ({
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.tiny : fontSize.xl2, fontSize: mobile ? fontSize.tiny : fontSize.xl2,
color: active color: active
? light
? Colors.theme1.gray20 ? Colors.theme1.gray20
: Colors.theme1.gray20, : Colors.theme1.greenCF
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}} }}
> >
{method.name} {method.name}
@ -87,7 +94,11 @@ const TransportMethod = ({
<View style={tw("flex flex-row-reverse items-center")}> <View style={tw("flex flex-row-reverse items-center")}>
<View <View
style={[ style={[
tw(`${active ? "bg-green-600" : "bg-gray-600"}`), tw(
`${
active ? "bg-green-600" : light ? "bg-gray-600" : "bg-white"
}`
),
{ {
height: fontSize.base + 10, height: fontSize.base + 10,
width: 1, width: 1,
@ -100,8 +111,12 @@ const TransportMethod = ({
fontFamily: "regular", fontFamily: "regular",
fontSize: mobile ? fontSize.base : fontSize.base, fontSize: mobile ? fontSize.base : fontSize.base,
color: active color: active
? Colors.theme1.green20 ? light
: Colors.theme1.gray20, ? Colors.theme1.gray20
: Colors.theme1.greenCF
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}} }}
> >
{separate(method.price) + " " + "تومان"} {separate(method.price) + " " + "تومان"}
@ -118,7 +133,7 @@ const TransportMethod = ({
style={{ style={{
fontSize: mobile ? fontSize.base : fontSize.xl, fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1.green79, color: light ? Colors.theme1.green79 : Colors.theme1.white,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}} }}
> >
@ -143,7 +158,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 theme: state.publicApi.theme,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -86,7 +86,6 @@ const styles = StyleSheet.create({
paddingBottom: 100, paddingBottom: 100,
}, },
container: { container: {
backgroundColor: "white",
flexDirection: "column", flexDirection: "column",
paddingVertical: 5, paddingVertical: 5,
paddingHorizontal: 16, paddingHorizontal: 16,

Loading…
Cancel
Save