Open
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes non-functional sign out buttons in the navbar and sidebar by properly integrating Redux logout functionality. Previously, the navbar's sign out caused redirect loops and the sidebar's sign out button had no functionality.
Changes:
- Added Redux logout action integration to both AppSidebar and MfNavbar components
- Changed the sign out path from 'signout' (non-existent route) to 'login'
- Created dedicated logout handler in sidebar that clears Redux state and localStorage token before navigation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/components/custom/sidebar/AppSidebar.tsx | Added Redux dispatch hook, logout action import, and handleLogout function with onClick handler for LogOut icon |
| src/components/custom/navbar/MfNavbar.tsx | Added Redux dispatch hook, logout action import, conditional logout dispatch in handleNavigate, and changed Sign Out path from 'signout' to 'login' |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Sign out buttons in navbar and sidebar didn't work properly: navbar caused redirect loops, sidebar had no functionality at all. I have integrated Redux logout action in both components properly. Imported useDispatch, logout action, and AppDispatch type. Modified navbar's handleNavigate to dispatch logout when navigating to login page. Created handleLogout function in sidebar that dispatches logout then navigates to login. This properly clears both Redux state and localStorage token, preventing redirect loops.
Screenshots, if any
before
before.mp4
after
after.mp4
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
[ x] If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
CONTRIBUTING.md.