Merged
Conversation
…ectedRoute with role-based navigation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
AppShellcomponent that provides a unified, role-aware layout and navigation for all authenticated pages. It restructures the routing logic so that all protected routes are now rendered inside this shell, ensuring a consistent layout and navigation experience. The loader component is also refactored for reuse and improved styling. Additionally, the route and navigation logic is cleaned up to use route constants and better handle authentication and authorization.Layout and Navigation Improvements:
AppShellcomponent that provides a sidebar, mobile drawer, topbar, and role-based navigation links for all authenticated pages. The shell displays user info, supports logout, and adapts navigation links based on user role. (frontend/src/components/layout/AppShell.tsx)Router.tsx) to wrap all protected routes inside theAppShell, ensuring consistent layout and navigation for all authenticated pages. (frontend/src/router/Router.tsx)Loader and Routing Enhancements:
AppLoadercomponent with improved styling, and updated usage inProtectedRouteandAppShell. (frontend/src/components/AppLoader.tsx,frontend/src/auth/ProtectedRoute.tsx,frontend/src/components/layout/AppShell.tsx) [1] [2]ProtectedRouteto use route constants fromROUTE_PATHSfor navigation and to use the newAppLoadercomponent. (frontend/src/auth/ProtectedRoute.tsx)Minor Code Cleanups:
AuthContext.tsx. (frontend/src/auth/AuthContext.tsx) [1] [2] [3] [4] [5]