added context provider for user profile

This commit was merged in pull request #11.
This commit is contained in:
2023-10-23 04:24:38 -07:00
parent de57daf98a
commit 5502bcd1ae
9 changed files with 157 additions and 69 deletions
+3 -6
View File
@@ -6,7 +6,6 @@ import TopNavbar from "@/components/_App/TopNavbar";
import Footer from "@/components/_App/Footer";
import ScrollToTop from "./ScrollToTop";
import ControlPanelModal from "./ControlPanelModal";
import AuthRoute from "middlewares/AuthRoute";
const Layout = ({ children }) => {
const router = useRouter();
@@ -34,9 +33,6 @@ const Layout = ({ children }) => {
// console.log("isAuthenticationPage:", isAuthenticationPage, router.pathname);
const title = isAuthenticationPage ? "CMC - auth" : "CMC - dashboard";
const mainWrapper = {
paddingLeft: typeof window !== "undefined" && isAuthenticationPage && "0",
};
return (
<>
@@ -46,8 +42,9 @@ const Layout = ({ children }) => {
</Head>
<div
className={`main-wrapper-content ${active ? "active" : ""}`}
style={mainWrapper}
className={`main-wrapper-content ${active ? "active" : ""} ${
isAuthenticationPage ? "authBox" : ""
}`}
>
{!isAuthenticationPage && (
<>
+4
View File
@@ -17,8 +17,12 @@ import MailOutlineIcon from "@mui/icons-material/MailOutline";
import ChatBubbleOutlineIcon from "@mui/icons-material/ChatBubbleOutline";
import AttachMoneyIcon from "@mui/icons-material/AttachMoney";
import Logout from "@mui/icons-material/Logout";
import { useUserProfile } from "contexts/userProfileContext";
const Profile = () => {
const { state } = useUserProfile();
const userProfile = state.userProfile;
const [anchorEl, setAnchorEl] = React.useState(null);
const open = Boolean(anchorEl);
const handleClick = (event) => {