feat(wallet): integrate @stellar/freighter-api with network switching & connection management#71
Merged
meshackyaro merged 1 commit intoJul 21, 2026
Conversation
… & connection management (trustflow-protocol#21) - Add comprehensive useWallet hook with connect/disconnect/network detection - Enhance ConnectButton with loading spinner and error states - Enhance WalletButton with network display, chevron, and i18n props - Refactor Navbar to use useWallet, removing local connection state - Create reusable DashboardSidebar component (replaces 4 page duplicates) - Add Wallet i18n keys for en/es locales - Ensure CI passes: lint, typecheck, and build all green
|
@Topmatrixmor2014 is attempting to deploy a commit to the Meshack Yaro 's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
meshackyaro
approved these changes
Jul 21, 2026
meshackyaro
left a comment
Contributor
There was a problem hiding this comment.
Well done and thanks for your contribution
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
This PR completes the Freighter wallet integration by implementing a robust connection lifecycle, network detection, and reusable shared UI components. The core objective — "Add a Connect Wallet button in the navbar that handles network switching and connection" — is now fully addressed.
Changes Made
1. New
useWalletHook (hooks/useWallet.ts) 📦A comprehensive hook that manages the full Freighter connection lifecycle:
isConnected()+getUserInfo()+isAllowed()every 2sgetNetworkDetails()to display testnet/mainnet/futurenetconnect()ConnectButtoncallssetAllowed()directly)disconnect()isBusyanderrorfields for UI feedback2. Backward Compatible
useAccount(hooks/useAccount.ts) 🔄useWallet()internally and returnsaccountonly3. Enhanced
ConnectButton🎯onConnectcallback for parent sync4. Enhanced
WalletButton💳5. Updated
Navbar🧭disconnectedstate — managed byuseWalletWalletButton6. Shared
DashboardSidebarComponent 📊useAccount()7. i18n Updates 🌐
New
Walletsection with 8 localized keys in both en/es.CI Verification ✅
Files Changed (16 files, +310 / -230)
hooks/useWallet.tshooks/useAccount.tsuseWallethooks/index.tsuseWalletbarrel exportcomponents/atoms/connect-button/index.tsxonConnectcallbackcomponents/atoms/connect-button/style.module.csscomponents/atoms/wallet-button/index.tsxcomponents/molecules/dashboard-sidebar/index.tsxcomponents/molecules/index.tsxcomponents/molecules/wallet-data/index.tsxuseWalletcomponents/organisms/navbar/index.tsxuseWallet, removes local state, i18npages/dashboard.tsxDashboardSidebarpages/dashboard/profile.tsxDashboardSidebarpages/dashboard/disputes.tsxDashboardSidebarpages/dashboard/settings.tsxDashboardSidebarmessages/en.jsonWalleti18n sectionmessages/es.jsonWalleti18n sectionHow to Test
npm run devand navigate tohttp://localhost:3000Closes #21