fet: show avatar, user name and logout
This commit is contained in:
		| @@ -5,6 +5,7 @@ import InventoryIcon from '@mui/icons-material/Inventory'; | ||||
| import LocalShippingIcon from '@mui/icons-material/LocalShipping'; | ||||
| import ExitToAppIcon from '@mui/icons-material/ExitToApp'; | ||||
| import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings'; | ||||
| import { useAuth } from '../context/AuthContext'; | ||||
|  | ||||
| import { useState } from 'react'; | ||||
|  | ||||
| @@ -32,6 +33,8 @@ export default function MenuDrawer({ zone = 'public', open, onClose, onSelect }) | ||||
|   const isMobile = useMediaQuery('(max-width:900px)'); | ||||
|   const items = menuOptions[zone]; | ||||
|  | ||||
|   const { logout } = useAuth(); | ||||
|  | ||||
|   return ( | ||||
|     <Drawer anchor="left" open={open} onClose={onClose} slotProps={{ | ||||
|       paper: { | ||||
| @@ -56,6 +59,12 @@ export default function MenuDrawer({ zone = 'public', open, onClose, onSelect }) | ||||
|           <ListItem key={index} onClick={() => { | ||||
|             onClose(); // Close drawer | ||||
|             onSelect?.(text); // Notify parent of selected item | ||||
|  | ||||
|             if (text === 'Logout') { | ||||
|               logout(); // cerrar sesión y redirigir | ||||
|             } else { | ||||
|               onSelect?.(text); // navegar al resto de vistas | ||||
|             } | ||||
|           }}> | ||||
|  | ||||
|             <ListItemIcon sx={{ color: '#DFCCBCFF' }}>{icon}</ListItemIcon> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Rodolfo Ruiz
					Rodolfo Ruiz