IMPLEMENT SIDEBAR AND TOP NUDGE DESIGN#25
Merged
codebestia merged 7 commits intomainfrom Mar 23, 2025
Merged
Conversation
codebestia
approved these changes
Mar 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes Issue #16
Overview
This pull request introduces a series of enhancements to the Sidebar, Navbar, and Profile components within the dapp folder. The updates focus on improving the user interface and overall functionality, including the implementation of a collapsible sidebar, dynamic active state management for menu items, and a refined profile display. These changes aim to deliver a more intuitive and seamless user experience.
Key Changes
Collapsible Sidebar Component
Introduced a collapsible sidebar that toggles between collapsed and expanded states on hover.
The sidebar remains collapsed by default, optimizing screen real estate, and expands when hovered over for easy navigation.
This feature enhances usability by reducing clutter while maintaining accessibility.
Active State Management
Implemented logic to dynamically manage the active state of menu items.
The "Dashboard" menu item is set as the default active state on page load.
Clicking on any menu item updates the active state, ensuring the selected link is always highlighted.
Navbar Component
Navigation Enhancements:
Updated the Navbar component to seamlessly integrate with the sidebar's collapsible behavior.
Ensured consistent styling and functionality across both components for a cohesive user experience.
Profile Component
Sidebar Profile Section:
Introduced a new SidebarProfile component to display user information at the bottom of the sidebar.
Features include:
Profile Image: Displays the user's profile picture with a fallback image (/Images/Profile.png) if none is provided.
User Name: Shows the user's name.
Wallet Address: Displays the user's wallet address, with truncation for longer addresses to maintain a clean layout.
Utilized next/image for optimized image rendering and lucide-react for the ChevronUp icon.
Page Component
Default Active State:
Set the "Dashboard" menu item as the default active state upon page load.
Ensured that the active state updates dynamically as users interact with the menu.
Files Updated
A. Sidebar.tsx:
Added collapsible behavior using hover events.
Implemented active state management for menu items.
B. Navbar.tsx:
C. Profile.tsx:
D. page.tsx:
Testing
Verified that the sidebar collapses and expands correctly on hover.
Tested to ensure the correct menu item is highlighted based on user interaction.
Confirmed that the profile image, user name, and wallet address render correctly.