Profile Admin
This commit is contained in:
@@ -5,7 +5,7 @@ import { Box, Divider, Typography, Stack, MenuItem, Avatar } from '@mui/material
|
||||
// components
|
||||
import MenuPopover from '../../../components/MenuPopover';
|
||||
import { IconButtonAnimate } from '../../../components/animate';
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import useAuth from '../../../hooks/useAuth';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -17,7 +17,7 @@ const MENU_OPTIONS = [
|
||||
},
|
||||
{
|
||||
label: 'Profile',
|
||||
linkTo: '/',
|
||||
linkTo: '/profile',
|
||||
},
|
||||
{
|
||||
label: 'Settings',
|
||||
@@ -43,7 +43,7 @@ export default function AccountPopover() {
|
||||
const handleLogout = () => {
|
||||
logout();
|
||||
navigate('/auth/login');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -97,7 +97,13 @@ export default function AccountPopover() {
|
||||
|
||||
<Stack sx={{ p: 1 }}>
|
||||
{MENU_OPTIONS.map((option) => (
|
||||
<MenuItem key={option.label} onClick={handleClose}>
|
||||
<MenuItem
|
||||
key={option.label}
|
||||
onClick={() => {
|
||||
handleClose();
|
||||
navigate(option.linkTo);
|
||||
}}
|
||||
>
|
||||
{option.label}
|
||||
</MenuItem>
|
||||
))}
|
||||
@@ -105,7 +111,9 @@ export default function AccountPopover() {
|
||||
|
||||
<Divider sx={{ borderStyle: 'dashed' }} />
|
||||
|
||||
<MenuItem sx={{ m: 1 }} onClick={handleLogout}>Logout</MenuItem>
|
||||
<MenuItem sx={{ m: 1 }} onClick={handleLogout}>
|
||||
Logout
|
||||
</MenuItem>
|
||||
</MenuPopover>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user