Skip to content

state: Add a "Disconnect Wallet" button with proper state cleanup #98

@AlAfiz

Description

@AlAfiz

Description

Users can currently connect their wallet, but there is no obvious way for them to log out or disconnect from the dApp.
We need to add a dropdown menu attached to the wallet address in the navigation bar that contains a "Disconnect" option.
When clicked, it must completely clear the wallet address from the global state, clear any local storage caches tied to the user, and return the UI to the logged-out state.
This is a basic privacy and security requirement for any Web3 application.

Requirements

  • Make the currently displayed Wallet Address in the Navbar clickable.
  • When clicked, open a small popup menu just below it.
  • Add a "Disconnect Wallet" button inside this menu, styled with a subtle red hover effect.
  • Write an onClick handler that resets the walletAddress state to null and clears the user's recent token searches from localStorage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions