worked | 30

temp
mahdi andalib 3 years ago
parent 1465ee1c99
commit c3240e3c67
  1. 19
      src/views/Address/index.js
  2. 25
      src/views/Dashboard/layouts/Main/Addresses/index.js
  3. 2
      src/views/DeliveryForm/Address/index.js

@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
import { useNavigate, useLocation } from "react-router-dom";
import { publicApi, userAddress, dialog, user } from "../../redux/actions";
import onInput from "../../utils/onInput";
import location from "../../utils/location";
import Input from "../../components/Input";
@ -624,24 +625,6 @@ export const Address = ({
)}
</div>
</div>
{/* {isMobile && (
<div
className="fixed top-0 left-0 flex justify-between items-center py-3 px-4 w-full"
style={{
backgroundColor: isDark ? "#061B30" : "white",
}}
>
<strong className="text-green4F text-lg font-semibold dark:text-white">
آدرس جدید
</strong>
<img
src={isDark ? arrowWhiteIcon : arrowBlueIcon}
alt="back"
className={`w-6 transform ${isDark ? " rotate-0" : "rotate-180"}`}
onClick={() => setPhase("deliveryForm")}
/>
</div>
)} */}
</div>
);
};

@ -7,11 +7,11 @@ import {
menu,
} from "../../../../../redux/actions";
import Loading from "../../../../../components/Loading";
//components
import Button from "../../../../../components/Button";
import { Link, useNavigate } from "react-router-dom";
import editButton from "../../../../../assets/icons/edit.svg";
import trash from "../../../../../assets/icons/trash.svg";
@ -81,6 +81,8 @@ const Location = ({
setMenu,
setDialog,
deleteAddress,
userAddressId,
loading,
}) => {
const [locationMenu, setLocationMenu] = React.useState(false);
@ -123,13 +125,17 @@ const Location = ({
}
>
<div className="w-full flex items-center justify-between">
<div className="w-4 h-4 flex flex-col items-center justify-center ml-1 bg-gray-200 rounded-full">
<div
className={`w-2 h-2 rounded-full ${
active === true ? "bg-blueC0" : ""
}`}
></div>
</div>
{loading && userAddressId !== address?.id ? (
<Loading size={2} color="bg-red-400" />
) : (
<div className="w-4 h-4 flex flex-col items-center justify-center ml-1 bg-gray-200 rounded-full">
<div
className={`w-2 h-2 rounded-full ${
active === true ? "bg-blueC0" : ""
}`}
></div>
</div>
)}
<div className="flex flex-col flex-1 mr-2">
{active && (
<div className="w-full flex justify-between mb-3">
@ -192,6 +198,7 @@ const mapStateToProps = (state) => ({
addresses: state.userAddress.list,
isMobile: state.publicApi.isMobile,
isDark: state.publicApi.isDark,
loading: state.userFactor.loading,
});
const mapDispatchToProps = {

@ -89,7 +89,7 @@ function Address({
: update({ userAddressId: address.id, userId })
}
>
<div className="flex flex-1 gap-x-4 ">
<div className="flex flex-1 items-center gap-x-4 ">
{loading && userAddressId !== address?.id ? (
<Loading size={2} color="bg-gray-400" />
) : (

Loading…
Cancel
Save