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

temp
mahdi 2 years ago
parent 4ac374d259
commit d81105e61d
  1. 2
      src/router.js
  2. 8
      src/views/Address/index.js
  3. 7
      src/views/Dashboard/layouts/Main/Addresses/index.js

@ -503,7 +503,7 @@ function Router({ isDark, isMobile, headerOptions, dialog, menu, setMenu }) {
back: true,
shown: true,
menu: false,
bookmark : 'contentId'
bookmark: "contentId",
}}
/>
}

@ -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 (
<div
className="flex flex-col lg:flex-row-reverse px-4 flex-1 lg:pt-0 pb-20 gap-5 lg:divide-x lg:divide-solid lg:divide-gray-200"
className={`flex flex-col lg:flex-row-reverse px-4 flex-1 lg:pt-0 pb-20 gap-5 lg:divide-x lg:divide-solid lg:divide-gray-200 ${
location.state.panel ? "mt-24" : "pt-0"
}`}
// style={{ minHeight: "calc(100vh - 500px)" }}
>
{!profilePage && (

@ -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 = ({
))}
</div>
<FloatingButton
action={() => {}}
action={() => navigation("/createAddress", { state: { panel: true } })}
// action={() => {}}
position={{ right: isMobile ? "" : 350, bottom: 50 }}
/>
</div>

Loading…
Cancel
Save