Skip to content

feat(wallet): add Freighter connect button and page - #844

Merged
dzekojohn4 merged 1 commit into
UnityChainxx:mainfrom
usmanimamu17-create:feat/issue-691-wallet-connect-button
Oct 20, 2026
Merged

dzekojohn4 merged 1 commit into
UnityChainxx:mainfrom
usmanimamu17-create:feat/issue-691-wallet-connect-button

Conversation

@usmanimamu17-create

Copy link
Copy Markdown

Summary

Adds a Freighter wallet connect button to the frontend and the /connect-wallet page that the navbar already links to. The button lets a user connect, see their active account address, and disconnect, and it restores the previously connected address after a page reload.

Problem

The navbar linked to /connect-wallet, but that route did not exist, so clicking "Connect Wallet" led to a missing page. There was a useWalletConnection hook with the wallet lifecycle logic, but no user-facing control wired to it, and nothing displayed the active account address. A connected session was also lost on every reload.

Changes Made

  • Added frontend/components/WalletConnectButton.jsx: a reusable control built on the existing useWalletConnection hook. It renders a "Connect Wallet" button while disconnected, shows the shortened active address with a "Disconnect" button once connected, displays a spinner while connecting, surfaces the hook's rejection/extension error, and persists the connected address in localStorage so a reload keeps showing the active session.
  • Added frontend/app/connect-wallet/page.tsx: the page the navbar links to, rendering the connect button.

Implementation Details

The button delegates all wallet operations to useWalletConnection, so user rejection and a missing extension are handled by the hook and shown inline via its error value. The connected address is mirrored to localStorage under stellarhunts.wallet.address on connect and cleared on disconnect so the session survives reloads. The display shortens the public key (GABC...WXYZ) while keeping the full address available via the title attribute.

Closes #686

Closes #688

Closes #689

Closes #691

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@usmanimamu17-create Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dzekojohn4 dzekojohn4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dzekojohn4
dzekojohn4 merged commit 16734dc into UnityChainxx:main Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants