Enhance navbar functionality: Close navbar on item click
Description: This PR enhances the functionality of the navbar by adding the ability to close it when the user clicks on any item inside it. Previously, the navbar could only be toggled open or closed by clicking on the navbar toggle button. With this update, a click outside the navbar or on any navbar item will now close the navbar.
Changes:
-
Added an event listener to the document body to handle clicks outside the navbar, triggering the navbar to close.
-
Modified the NavbarLeft component to include an onClick handler for each item inside the navbar, which closes the navbar when clicked.
-
Added appropriate comments to highlight the changes made for clarity and maintainability.
-
I have added a transition effect that will be triggered when the navbar is closed.
These changes improve user experience by providing a more intuitive interaction with the navbar, allowing users to easily close it when they've finished interacting with it.
https://github.com/HimanshuNarware/Devlabs/assets/140513098/fbf18731-7c5c-4853-b90e-419be7befa40
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| devlabs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 15, 2024 0:19am |
@kushalkumar1362 is attempting to deploy a commit to the himanshunarware's projects Team on Vercel.
A member of the Team first needs to authorize it.
@HimanshuNarware @panwar8279 Please check, this is my first contribution #264 Issue