From d81105e61d3d3b4ba731da6d1946d69de99e58ca Mon Sep 17 00:00:00 2001 From: mahdi Date: Wed, 15 Jun 2022 11:38:23 +0430 Subject: [PATCH] update router.js, src/views/Address/index.js, src/views/Dashboard/layouts/Main/Addresses/index.js and src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js --- src/router.js | 2 +- src/views/Address/index.js | 8 ++++++-- src/views/Dashboard/layouts/Main/Addresses/index.js | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/router.js b/src/router.js index 11fdab6..29f85ff 100644 --- a/src/router.js +++ b/src/router.js @@ -503,7 +503,7 @@ function Router({ isDark, isMobile, headerOptions, dialog, menu, setMenu }) { back: true, shown: true, menu: false, - bookmark : 'contentId' + bookmark: "contentId", }} /> } diff --git a/src/views/Address/index.js b/src/views/Address/index.js index 148dec5..2215152 100644 --- a/src/views/Address/index.js +++ b/src/views/Address/index.js @@ -1,6 +1,6 @@ import React, { useState, useEffect } from "react"; import { connect } from "react-redux"; -import { useNavigate } from "react-router-dom"; +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"; @@ -44,8 +44,10 @@ export const Address = ({ const [addressFields, setAddressFields] = useState({}); const [mapAddress, setMapAddress] = useState(null); const navigation = useNavigate(); + const location = useLocation(); useEffect(() => { + setHeaderOptions(headerOptions); if (province.length <= 1) { getProvince(); } @@ -288,7 +290,9 @@ export const Address = ({ return (
{!profilePage && ( diff --git a/src/views/Dashboard/layouts/Main/Addresses/index.js b/src/views/Dashboard/layouts/Main/Addresses/index.js index 0b6669f..c210446 100644 --- a/src/views/Dashboard/layouts/Main/Addresses/index.js +++ b/src/views/Dashboard/layouts/Main/Addresses/index.js @@ -6,6 +6,8 @@ import { userAddress, userFactor } from "../../../../../redux/actions"; import Button from "../../../../../components/Button"; import FloatingButton from "../../../../../components/FloatingButton"; +import { Link, useNavigate } from "react-router-dom"; + //assets import menuIcon from "./menu.svg"; @@ -20,6 +22,8 @@ const ProfileAddress = ({ isMobile, isDark, }) => { + const navigation = useNavigate(); + React.useEffect(() => { getFactorInfo({ userId }); getList(); @@ -40,7 +44,8 @@ const ProfileAddress = ({ ))}
{}} + action={() => navigation("/createAddress", { state: { panel: true } })} + // action={() => {}} position={{ right: isMobile ? "" : 350, bottom: 50 }} />