|
|
@ -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 = { |
|
|
|