From f43e7ca0e5a42d0a99f4ce177b82e0fdd17824ed Mon Sep 17 00:00:00 2001 From: hosseintaromi Date: Fri, 18 Jul 2025 14:03:07 +0330 Subject: [PATCH] feat(navigation): integrate roles into app navigation - Add all roles routes to App.tsx - Add roles menu item to sidebar with Shield icon - Update user display to use AdminUser properties - Fix TypeScript compatibility issues with new auth types --- src/App.tsx | 13 +++++++++++++ src/components/layout/Header.tsx | 8 ++++---- src/components/layout/Sidebar.tsx | 18 +++++++++++++----- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 927df24..1c94939 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,6 +16,12 @@ import { Reports } from './pages/Reports'; import { Notifications } from './pages/Notifications'; import { Layout } from './components/layout/Layout'; +// Roles Pages +import RolesListPage from './pages/roles/roles-list/RolesListPage'; +import RoleFormPage from './pages/roles/role-form/RoleFormPage'; +import RoleDetailPage from './pages/roles/role-detail/RoleDetailPage'; +import RolePermissionsPage from './pages/roles/role-permissions/RolePermissionsPage'; + const ProtectedRoute = ({ children }: { children: any }) => { const { user } = useAuth(); return user ? children : ; @@ -36,6 +42,13 @@ const AppRoutes = () => { } /> } /> } /> + + {/* Roles Routes */} + } /> + } /> + } /> + } /> + } /> ); diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index a1e6350..185a47e 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -51,11 +51,11 @@ export const Header = ({ onMenuClick }: HeaderProps) => { >
- {user?.name?.charAt(0) || 'A'} + {user?.first_name?.charAt(0) || 'A'}
- {user?.name || 'کاربر'} + {user?.first_name} {user?.last_name} @@ -64,10 +64,10 @@ export const Header = ({ onMenuClick }: HeaderProps) => {

- {user?.name} + {user?.first_name} {user?.last_name}

- {user?.email} + {user?.username}