Repository navigation
feat(wallet): add Freighter connect button and page - #844
Merged
dzekojohn4 merged 1 commit intoOct 20, 2026
Merged
dzekojohn4 merged 1 commit into
dzekojohn4 merged 1 commit into
Conversation
|
@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! 🚀 |
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.
Summary
Adds a Freighter wallet connect button to the frontend and the
/connect-walletpage 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 auseWalletConnectionhook 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
frontend/components/WalletConnectButton.jsx: a reusable control built on the existinguseWalletConnectionhook. 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 inlocalStorageso a reload keeps showing the active session.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 itserrorvalue. The connected address is mirrored tolocalStorageunderstellarhunts.wallet.addresson 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