-
Notifications
You must be signed in to change notification settings - Fork 111
Fixes #140 Highlight home in navbar when user is on home page #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
π WalkthroughWalkthroughModified the CustomDrawer component to detect the active route using React Navigation's state API and conditionally apply pink text color to the Home menu item when that route is active, addressing the lack of visual feedback indicating the current page. Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~8 minutes Poem
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
π Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
Frontend/src/Screens/CustomDrawer.jsx
π Additional comments (2)
Frontend/src/Screens/CustomDrawer.jsx (2)
12-12: LGTM! Import is appropriate.The
useNavigationStateimport is correctly added and necessary for detecting the active route.
156-175: Consider highlighting other menu items when active.The implementation successfully addresses issue #140 by highlighting the Home item. However, from a UX consistency perspective, other menu items (Tasks, Weight, Medicine, etc.) don't receive similar visual feedback when they're the active screen.
Should the active route highlighting be extended to all menu items for consistency? The current
currentRouteNamelogic would already support this:<TouchableOpacity onPress={() => navigateTo('AllTasks')} style={styles.link}> <Text style={currentRouteName === 'AllTasks' ? styles.activeLink : styles.inactiveLink}> Tasks & AI Recommendations </Text> </TouchableOpacity>If this was intentional and only Home should be highlighted per the requirements, please disregard this comment.
|
inc screenshots of changes |

Closes #140
π Description
π§ Changes Made
π· Screenshots or Visual Changes (if applicable)
π€ Collaboration
Collaborated with:
@username(optional)β Checklist
Summary by CodeRabbit
βοΈ Tip: You can customize this high-level summary in your review settings.