Devlabs icon indicating copy to clipboard operation
Devlabs copied to clipboard

Enhance navbar functionality: Close navbar on item click

Open kushalkumar1362 opened this issue 1 year ago • 3 comments

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:

  1. Added an event listener to the document body to handle clicks outside the navbar, triggering the navbar to close.

  2. Modified the NavbarLeft component to include an onClick handler for each item inside the navbar, which closes the navbar when clicked.

  3. Added appropriate comments to highlight the changes made for clarity and maintainability.

  4. 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

kushalkumar1362 avatar May 14 '24 03:05 kushalkumar1362

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

vercel[bot] avatar May 14 '24 03:05 vercel[bot]

@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.

vercel[bot] avatar May 14 '24 03:05 vercel[bot]

@HimanshuNarware @panwar8279 Please check, this is my first contribution #264 Issue

kushalkumar1362 avatar May 15 '24 04:05 kushalkumar1362