Skip to content

fix(navbar): show Dashboard instead of Classes label for admin users - #601

Open
AbiramiR-27 wants to merge 2 commits into
freeCodeCamp:mainfrom
AbiramiR-27:fix/admin-navbar-label
Open

fix(navbar): show Dashboard instead of Classes label for admin users#601
AbiramiR-27 wants to merge 2 commits into
freeCodeCamp:mainfrom
AbiramiR-27:fix/admin-navbar-label

Conversation

@AbiramiR-27

Copy link
Copy Markdown

Checklist:

Closes #597

This PR dynamically renames the navbar link "Classes" to "Dashboard" for ADMIN users to match the actual destination page.

Changes:

  • Added the custom session callback to NextAuth config to expose user roles to the client.
  • Added a helper function in Navbar to recursively find and update the label for links to /classes based on user role.
  • Added unit tests to navbar.test.jsx to cover both admin and teacher role scenarios.

@AbiramiR-27
AbiramiR-27 requested a review from a team as a code owner June 6, 2026 14:16

@NewtonLC NewtonLC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AbiramiR-27, thank you for working on this issue! I tested your code, and it works as expected. Before merging this though, I'd like to modify it to also hide this button if the user is not signed in, or if the user has a role other than ADMIN or TEACHER.

Would you be alright with adding those changes? If not, no worries! I can patch it later this week.

@AbiramiR-27

Copy link
Copy Markdown
Author

Thank you for testing the changes and for the feedback! I'd be happy to make the additional updates. I'll modify the implementation to hide the button when the user is not signed in and when the user's role is neither ADMIN nor TEACHER, then update the PR shortly.

@NewtonLC NewtonLC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! This PR is now awaiting a review from @utsab before merging.

@AbiramiR-27

Copy link
Copy Markdown
Author

Hi @utsab, Gentle ping for a final review on this. @NewtonLC has approved it. Thank you!

@AbiramiR-27

Copy link
Copy Markdown
Author

Hi @utsab @NewtonLC , just following up to see if you've had a chance to review this PR. In the meantime, I'll go ahead and resolve the merge conflicts in components/navbar.js. Thanks!

@AbiramiR-27
AbiramiR-27 force-pushed the fix/admin-navbar-label branch from 13b92af to 3e5d6f1 Compare August 13, 2026 06:35
@NewtonLC

Copy link
Copy Markdown
Contributor

Hi Abirami, I apologize for the wait. At the moment, we still aren't able to give a clear date for when we can review and merge your PRs. I still appreciate your work on both of them and will definitely reach out once we are able to review them.

@AbiramiR-27

AbiramiR-27 commented Aug 17, 2026

Copy link
Copy Markdown
Author

Hi @NewtonLC,
Thanks for the update! No worries at all. Just reach out whenever the team is ready to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Admin navbar label shows “Classes” instead of “Dashboard”

2 participants