From b2b64262b862f885db4a2190bedb314353677ebf Mon Sep 17 00:00:00 2001 From: Dallas <71103219+LeleDallas@users.noreply.github.com> Date: Mon, 8 May 2023 00:50:13 +0200 Subject: [PATCH] fix: Breadcrumb deprecated item --- src/Account/Account.tsx | 33 +++++++++++---- src/Consumer/Building/AddNewBuilding.tsx | 18 +++++--- src/Consumer/Building/BuildingsTab.tsx | 24 +++++++---- src/Consumer/Invoices/Invoices.tsx | 18 +++++--- src/Consumer/Invoices/InvoicesModal.tsx | 44 +++++++++++++------- src/Consumer/Invoices/InvoicesWrapper.tsx | 16 ++++--- src/Consumer/Organizations/Organizations.tsx | 14 +++++-- src/accountUtils.tsx | 10 ++++- src/globalUtils.tsx | 4 +- 9 files changed, 125 insertions(+), 56 deletions(-) diff --git a/src/Account/Account.tsx b/src/Account/Account.tsx index 7736fd6..2a93903 100644 --- a/src/Account/Account.tsx +++ b/src/Account/Account.tsx @@ -12,8 +12,15 @@ import AccountNotification from "./RightSide/AccountNotification"; import OrganizationDrawer from "./OrganizationDrawer"; import { accountMenu } from "../globalUtils"; import { accountItems } from "../accountUtils"; +import { UserProps } from "../types"; -const Account = ({ updateRoute, user, avatar, socket }: any) => { +interface AccountProps { + updateRoute: any, + user: UserProps, + avatar: string +} + +const Account = ({ updateRoute, user, avatar }: AccountProps) => { const navigate = useNavigate() const location = useLocation() const [visible, setVisible] = useState(false) @@ -28,11 +35,19 @@ const Account = ({ updateRoute, user, avatar, socket }: any) => { }} > - - Home - Profile - {window.location.pathname.split("/")[2]} - + Profile + }, + { + title: {window.location.pathname.split("/")[2]} + } + ]} + /> { - {location.pathname === "/Profile/Edit" && } + {location.pathname === "/Profile/Edit" && } {location.pathname === "/Profile/Notification" && } {location.pathname === "/Profile/Activity" && } - {location.pathname === "/Profile/Security" && updateRoute("/Profile/Password")} />} + {location.pathname === "/Profile/Security" && updateRoute("/Profile/Password")} />} {location.pathname === "/Profile/Password" && } {user.type === "Building" && setVisible(false)} />} {user.type === "Vendor" && setVisible(false)} />} - + ) } export default Account \ No newline at end of file diff --git a/src/Consumer/Building/AddNewBuilding.tsx b/src/Consumer/Building/AddNewBuilding.tsx index 6f2de9c..42c388e 100644 --- a/src/Consumer/Building/AddNewBuilding.tsx +++ b/src/Consumer/Building/AddNewBuilding.tsx @@ -53,11 +53,19 @@ const AddNewBuildings = (user: UserProps) => { > {show && } - - Home - Buildings - Create Building - + Buildings + }, + { + title: Create Building + }, + ]} + /> { > {show && } - - Home - Buildings - + Buildings + } + ]} + /> { onChange={(val) => setFilter(val)} defaultValue="Address" style={{ width: "35%" }} - > - - - + options={[ + { value: "Address", label: "Address", }, + { value: "Building", label: "Building", } + ]} + /> { diff --git a/src/Consumer/Invoices/Invoices.tsx b/src/Consumer/Invoices/Invoices.tsx index 375c910..15b3a19 100644 --- a/src/Consumer/Invoices/Invoices.tsx +++ b/src/Consumer/Invoices/Invoices.tsx @@ -41,11 +41,19 @@ const Invoices = ({ user }: Invoices) => { }} > - - Home - Invoices - {filter} - + Invoices + }, + { + title: {filter} + }, + ]} + /> , + }, + { + key: '2', + label: `Gas`, + children: + }, + { + key: '3', + label: `Water`, + children: + }, + ]; + return ( - setVisible(!visible)} onCancel={() => setVisible(!visible)}> - - - - - - - - - - - + setVisible(!visible)} + onCancel={() => setVisible(!visible)} + > + ) } diff --git a/src/Consumer/Invoices/InvoicesWrapper.tsx b/src/Consumer/Invoices/InvoicesWrapper.tsx index 57114f3..2acbede 100644 --- a/src/Consumer/Invoices/InvoicesWrapper.tsx +++ b/src/Consumer/Invoices/InvoicesWrapper.tsx @@ -1,7 +1,5 @@ import { PageHeader } from "@ant-design/pro-components" import { Breadcrumb, Card, Carousel, Col, Divider, Empty, Layout, Row, Statistic } from "antd" -import ReactApexChart from "react-apexcharts" -import { pieOptions } from "./utilsInvoices" import IconFont from "../../Iconfont" interface ChangeTitle { @@ -49,10 +47,16 @@ const InvoicesWrapper = ({ }} > - - Home - {window.location.pathname.split("/")[1]} - + {window.location.pathname.split("/")[1]} + }, + ]} + /> { }} > - - Home - Organizations - + Organizations + }, + ]} + /> void, setL setLoad(false) }, 300) }) - .catch(() => message.error("Error on Update Data")) + .catch(() => { + message.error("Error on Update Data") + setLoad(false) + }) } export const updateUserData = async (user: any, name: string, surname: string, email: string, dispatch: AppDispatch, setVisible: (arg: boolean) => void) => @@ -98,7 +101,10 @@ export const updateUserData = async (user: any, name: string, surname: string, e .then(res => { dispatch(updateUser(res.data)) setVisible(false) - }).catch(() => message.error("Error on Update Data")) + }).catch(() => { + message.error("Error on Update Data") + setVisible(false) + }) export const activityColumns: any = [ diff --git a/src/globalUtils.tsx b/src/globalUtils.tsx index d33bbe3..0c04dc9 100644 --- a/src/globalUtils.tsx +++ b/src/globalUtils.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import { Button, Col, Row, Carousel as AntCarousel, Menu, } from 'antd'; +import { Button, Col, Row, Carousel as AntCarousel, } from 'antd'; import QueueAnim, { IObject } from 'rc-queue-anim'; import { isMobile } from 'react-device-detect'; import TweenOne from 'rc-tween-one'; -import { GetItem, User, UserProps } from './types'; +import { GetItem, UserProps } from './types'; import { UploadRequestOption } from "rc-upload/lib/interface"; import { MenuProps } from 'antd/lib/menu'; import moment from 'moment';