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);