Fixes #140 Highlight home in navbar when user is on home page#147
Fixes #140 Highlight home in navbar when user is on home page#147DeveloperAmrit wants to merge 1 commit intoAOSSIE-Org:mainfrom
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.
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 |
|
@DeveloperAmrit |

Closes #140
📝 Description
When user will be on home page the navbar will indicate this by making the home text pink.
🔧 Changes Made
Updated Frontend/src/Screens/CustomDrawer.jsx
📷 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.