Add ProfilePage component and integrate with navigation and sidebar

Introduced `ProfilePage` to display user profile details, including name, email, and role. Updated navigation logic in `App.js` to support the new "profile" view and added click-to-navigate functionality in the sidebar user section. Enhanced sidebar user actions with improved logout interactions.
This commit is contained in:
2025-11-22 22:31:21 -04:00
parent 15c5c60591
commit 38945d6336
3 changed files with 78 additions and 2 deletions

View File

@@ -62,13 +62,21 @@ const Sidebar = ({ isMobileMenuOpen, onToggleMobileMenu, activeView = 'dashboard
</div>
<div className="sidebar-footer">
<div className="user-info">
<div
className="user-info"
role="button"
tabIndex={0}
onClick={() => onNavigate?.('profile')}
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onNavigate?.('profile'); } }}
title="Ver perfil"
style={{ cursor: 'pointer' }}
>
<div className="user-avatar">JP</div>
<div className="user-details">
<div className="user-name">Juan Pérez</div>
<div className="user-role">Administrador</div>
</div>
<a href="#" style={{color: 'white'}} onClick={(e) => { e.preventDefault(); handleLogout(); }} title="Cerrar sesión">
<a href="#" style={{color: 'white'}} onClick={(e) => { e.preventDefault(); e.stopPropagation(); handleLogout(); }} title="Cerrar sesión">
<i className="fas fa-sign-out-alt"></i>
</a>
</div>