diff --git a/src/views/Address/index.js b/src/views/Address/index.js index 73027ce..9d82a97 100644 --- a/src/views/Address/index.js +++ b/src/views/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 = ({ )} - {/* {isMobile && ( -
- - آدرس جدید - - back setPhase("deliveryForm")} - /> -
- )} */} ); }; diff --git a/src/views/Dashboard/layouts/Main/Addresses/index.js b/src/views/Dashboard/layouts/Main/Addresses/index.js index 50c32e7..d2bb971 100644 --- a/src/views/Dashboard/layouts/Main/Addresses/index.js +++ b/src/views/Dashboard/layouts/Main/Addresses/index.js @@ -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 = ({ } >
-
-
-
+ {loading && userAddressId !== address?.id ? ( + + ) : ( +
+
+
+ )}
{active && (
@@ -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 = { diff --git a/src/views/DeliveryForm/Address/index.js b/src/views/DeliveryForm/Address/index.js index edab2cb..5a4a140 100644 --- a/src/views/DeliveryForm/Address/index.js +++ b/src/views/DeliveryForm/Address/index.js @@ -89,7 +89,7 @@ function Address({ : update({ userAddressId: address.id, userId }) } > -
+
{loading && userAddressId !== address?.id ? ( ) : (