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, back: true,
shown: true, shown: true,
menu: false, menu: false,
bookmark : 'contentId' bookmark: "contentId",
}} }}
/> />
} }

@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { connect } from "react-redux"; 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 { publicApi, userAddress, dialog, user } from "../../redux/actions";
import onInput from "../../utils/onInput"; import onInput from "../../utils/onInput";
import location from "../../utils/location"; import location from "../../utils/location";
@ -44,8 +44,10 @@ export const Address = ({
const [addressFields, setAddressFields] = useState({}); const [addressFields, setAddressFields] = useState({});
const [mapAddress, setMapAddress] = useState(null); const [mapAddress, setMapAddress] = useState(null);
const navigation = useNavigate(); const navigation = useNavigate();
const location = useLocation();
useEffect(() => { useEffect(() => {
setHeaderOptions(headerOptions);
if (province.length <= 1) { if (province.length <= 1) {
getProvince(); getProvince();
} }
@ -288,7 +290,9 @@ export const Address = ({
return ( return (
<div <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)" }} // style={{ minHeight: "calc(100vh - 500px)" }}
> >
{!profilePage && ( {!profilePage && (

@ -6,6 +6,8 @@ import { userAddress, userFactor } from "../../../../../redux/actions";
import Button from "../../../../../components/Button"; import Button from "../../../../../components/Button";
import FloatingButton from "../../../../../components/FloatingButton"; import FloatingButton from "../../../../../components/FloatingButton";
import { Link, useNavigate } from "react-router-dom";
//assets //assets
import menuIcon from "./menu.svg"; import menuIcon from "./menu.svg";
@ -20,6 +22,8 @@ const ProfileAddress = ({
isMobile, isMobile,
isDark, isDark,
}) => { }) => {
const navigation = useNavigate();
React.useEffect(() => { React.useEffect(() => {
getFactorInfo({ userId }); getFactorInfo({ userId });
getList(); getList();
@ -40,7 +44,8 @@ const ProfileAddress = ({
))} ))}
</div> </div>
<FloatingButton <FloatingButton
action={() => {}} action={() => navigation("/createAddress", { state: { panel: true } })}
// action={() => {}}
position={{ right: isMobile ? "" : 350, bottom: 50 }} position={{ right: isMobile ? "" : 350, bottom: 50 }}
/> />
</div> </div>

Loading…
Cancel
Save