fix: close mobile menu when Read Articles link is clicked - #2186
Conversation
|
Thank you @, for creating the PR and contributing to our UltimateHealth project 💗. |
❌ PR Validation FailedThis PR was marked as To resolve this, please ensure your PR description links an issue (e.g., |
|
/review |
There was a problem hiding this comment.
## Problem Statement
The mobile navigation menu is not opening on certain pages such as `/articles` and `/medical-glossary`, even though the hamburger menu icon is being clicked.
### Root Cause Investigation
The issue appears to be related to the Navbar component used on these pages:
- `web/src/components/layout/Navbar.tsx`
Initial investigation suggests that the mobile navigation container may be using an inline style:
```tsx
style={{ display: 'none' }}Since inline styles have higher priority than CSS classes, this could prevent the .mobile-nav.open class from changing the menu's visibility when the hamburger icon is toggled.
Proposed Fix
- Inspect
web/src/components/layout/Navbar.tsx. - Remove the hardcoded inline
display: nonestyle from the mobile navigation container. - Allow the visibility to be controlled entirely through CSS classes (e.g.,
.mobile-navand.mobile-nav.open).
Additional Investigation
While testing the application, the production build should also be verified using:
npm run buildIf the build fails, inspect the reported files for syntax issues. One area to check is:
web/src/app/globals.css
Look for any invalid CSS syntax, such as unmatched or extra braces, and correct them if found.
Acceptance Criteria
- Mobile navigation opens and closes correctly on
/articles. - Mobile navigation opens and closes correctly on
/medical-glossary. - No inline styles override the mobile navigation visibility.
-
npm run buildcompletes successfully without errors.
❌ PR Validation FailedThis PR was marked as To resolve this, please ensure your PR description links an issue (e.g., |
|
"Hi @SB2318, I have fixed both issues - removed the inline style={{ display: 'none' }} from the mobile nav container in Navbar.tsx and fixed the extra } syntax error in globals.css. Build is now passing successfully. Please review!" |
❌ PR Validation FailedThis PR was marked as To resolve this, please ensure your PR description links an issue (e.g., |
|
Congratulations, Your pull request has been successfully merged 🥳🎉 Thank you for your contribution to the project 🚀 Keep Contributing!! ✨ |
PR Description
Please include a summary of the changes and the related issue. Describe your changes in detail.
Type of Change
Select your work-area
Related Issue
Please provide a link to the issue solved if applicable.
Add your Work Example
📷 Add a Snapshot
Fixes (mention the issue number which this fixes)
#closes
Checklist
Undertaking
My code follows the style guidelines of this project.
I have performed a self-review of my code.
I have commented my code, particularly in hard-to-understand areas.
I have made corresponding changes to the documentation.
I have checked for plagiarism and assure its authenticity.
I have read and followed the code of conduct for this repository. I understand that violation of this undertaking may have legal consequences.
I Agree