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 (
<View style={tw("w-full mt-2")}>
<View style={tw("p-0 m-0 flex ")}>
@ -112,8 +116,8 @@ const Address = ({
<TouchableOpacity
style={[
{
backgroundColor: Colors.theme1.grayE3 + "44",
borderColor: Colors.theme1.gray2077 + "55",
backgroundColor: light ? Colors.theme1.grayE3 + "44" : null,
borderColor: light ? Colors.theme1.gray2077 + "55" : Colors.theme1.grayE3,
borderWidth: 1.5,
},
tw(
@ -126,7 +130,7 @@ const Address = ({
style={{
fontFamily: "regular",
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={{
marginRight: 5,
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 [activeDate, setActiveDate] = useState(transportDate?.times[0]);
const light = React.useMemo(() => {
return theme === "light";
}, [theme]);
const Time = useCallback(({ time, active }) => {
return (
<Pressable
style={[
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.grayE3 + "44",
: Colors.theme1.grayE3 + "44" : null,
borderWidth: 1.5,
borderColor: active
? Colors.theme1.greenCF
@ -34,8 +38,8 @@ const TransportDate = ({ transportDate, mobile, theme }) => {
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 }) => {
</Pressable>
);
}, []);
return (
<View style={tw(`w-full ${mobile ? "mt-4" : "mt-4"}`)}>
<Text
style={{
fontSize: mobile ? fontSize.base : fontSize.xl2,
fontFamily: "bold",
color: Colors.theme1.green79,
color: light ? Colors.theme1.green79 : Colors.theme1.white,
textAlign : ios ? "right" : "auto",
}}
>

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

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

Loading…
Cancel
Save