29 lines
1.2 KiB
JavaScript
29 lines
1.2 KiB
JavaScript
import React, { useEffect } from "react";
|
|
import { useOrganizationModal } from "./hooks/useOrganization";
|
|
import OrganizationModal from "./components/Organization/OrganizationModal";
|
|
import { useAuthModal, useModal } from "./hooks/useAuth";
|
|
import SwitchTenant from "./pages/authentication/SwitchTenant";
|
|
import ChangePasswordPage from "./pages/authentication/ChangePassword";
|
|
import NewCollection from "./components/collections/ManageCollection";
|
|
import ServiceProjectTeamAllocation from "./components/ServiceProject/ServiceProjectTeam/ServiceProjectTeamAllocation";
|
|
|
|
const ModalProvider = () => {
|
|
const { isOpen, onClose } = useOrganizationModal();
|
|
const { isOpen: isAuthOpen } = useAuthModal();
|
|
const { isOpen: isChangePass } = useModal("ChangePassword");
|
|
const { isOpen: isCollectionNew } = useModal("newCollection");
|
|
const { isOpen: isServiceTeamAllocation } = useModal("ServiceTeamAllocation");
|
|
|
|
return (
|
|
<>
|
|
{isOpen && <OrganizationModal />}
|
|
{isAuthOpen && <SwitchTenant />}
|
|
{isChangePass && <ChangePasswordPage />}
|
|
{isCollectionNew && <NewCollection />}
|
|
{isServiceTeamAllocation && <ServiceProjectTeamAllocation />}
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default ModalProvider;
|