|
|
|
@ -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 = ({ |
|
|
|
|
<View style={tw("flex flex-row-reverse items-center")}> |
|
|
|
|
<View |
|
|
|
|
style={[ |
|
|
|
|
tw(`${active ? "bg-green-600" : "bg-gray-600"}`), |
|
|
|
|
tw( |
|
|
|
|
`${ |
|
|
|
|
active ? "bg-green-600" : light ? "bg-gray-600" : "bg-white" |
|
|
|
|
}` |
|
|
|
|
), |
|
|
|
|
{ |
|
|
|
|
height: fontSize.base + 10, |
|
|
|
|
width: 1, |
|
|
|
@ -100,8 +111,12 @@ const TransportMethod = ({ |
|
|
|
|
fontFamily: "regular", |
|
|
|
|
fontSize: mobile ? fontSize.base : fontSize.base, |
|
|
|
|
color: active |
|
|
|
|
? Colors.theme1.green20 |
|
|
|
|
: Colors.theme1.gray20, |
|
|
|
|
? light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.greenCF |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.white, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{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 = { |
|
|
|
|