From 97dca1a10b51190d7abb34149eef28e8a68e29de Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Tue, 7 Oct 2025 14:53:48 +0530 Subject: [PATCH] removed unused code --- src/ModalProvider.jsx | 5 +- .../Context/ChangePasswordContext.jsx | 42 -- src/components/Employee/EmpBanner.jsx | 9 +- src/components/Layout/Header.jsx | 8 +- src/hooks/useAttendance.js | 2 +- src/hooks/useAuth.jsx | 31 +- src/main.tsx | 6 - src/pages/Activities/AttendancePage.jsx | 5 +- src/pages/Gallary/ImageGallary.jsx | 499 ------------------ src/pages/Gallary/ImagePop.jsx | 111 ---- src/pages/Gallary/ModalContext.jsx | 23 - src/pages/authentication/ChangePassword.jsx | 39 +- src/router/AppRoutes.jsx | 1 - src/slices/localVariablesSlice.jsx | 33 +- 14 files changed, 87 insertions(+), 727 deletions(-) delete mode 100644 src/components/Context/ChangePasswordContext.jsx delete mode 100644 src/pages/Gallary/ImageGallary.jsx delete mode 100644 src/pages/Gallary/ImagePop.jsx delete mode 100644 src/pages/Gallary/ModalContext.jsx diff --git a/src/ModalProvider.jsx b/src/ModalProvider.jsx index b9a2dea9..c4e0779f 100644 --- a/src/ModalProvider.jsx +++ b/src/ModalProvider.jsx @@ -1,17 +1,20 @@ import React, { useEffect } from "react"; import { useOrganizationModal } from "./hooks/useOrganization"; import OrganizationModal from "./components/Organization/OrganizationModal"; -import { useAuthModal } from "./hooks/useAuth"; +import { useAuthModal, useModal } from "./hooks/useAuth"; import SwitchTenant from "./pages/authentication/SwitchTenant"; +import ChangePasswordPage from "./pages/authentication/ChangePassword"; const ModalProvider = () => { const { isOpen, onClose } = useOrganizationModal(); const { isOpen: isAuthOpen } = useAuthModal(); + const {isOpen:isChangePass} = useModal("ChangePassword") return ( <> {isOpen && } {isAuthOpen && } + {isChangePass && } ); }; diff --git a/src/components/Context/ChangePasswordContext.jsx b/src/components/Context/ChangePasswordContext.jsx deleted file mode 100644 index 0854b346..00000000 --- a/src/components/Context/ChangePasswordContext.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React, { createContext, useState, useContext } from "react"; -import ChangePasswordPage from "../../pages/authentication/ChangePassword"; - -const ChangePasswordContext = createContext(); - -export const ChangePasswordProvider = ({ children }) => { - const [isChangePasswordOpen, setIsChangePasswordOpen] = useState(false); - - const openChangePassword = () => setIsChangePasswordOpen(true); - const closeChangePassword = () => setIsChangePasswordOpen(false); - - return ( - - {children} - - {isChangePasswordOpen && ( - <> - {/* This is the main Bootstrap modal container */} - {/* It provides the fixed positioning and high z-index */} -
- {/* The ChangePasswordPage component itself contains the modal-dialog and modal-content */} - -
- - {/* The modal backdrop */} -
- - )} -
- ); -}; - -export const useChangePassword = () => useContext(ChangePasswordContext); \ No newline at end of file diff --git a/src/components/Employee/EmpBanner.jsx b/src/components/Employee/EmpBanner.jsx index bb019bc6..500e7d0e 100644 --- a/src/components/Employee/EmpBanner.jsx +++ b/src/components/Employee/EmpBanner.jsx @@ -1,12 +1,13 @@ import React, { useState, useEffect } from "react"; -import { useChangePassword } from "../../components/Context/ChangePasswordContext"; + import GlobalModel from "../common/GlobalModel"; import ManageEmployee from "./ManageEmployee"; import { formatUTCToLocalTime } from "../../utils/dateUtils"; +import { useModal } from "../../hooks/useAuth"; const EmpBanner = ({ profile, loggedInUser }) => { - const { openChangePassword } = useChangePassword(); + const {onOpen} = useModal("ChangePassword") const [showModal, setShowModal] = useState(false); return ( @@ -86,7 +87,7 @@ const EmpBanner = ({ profile, loggedInUser }) => {