feat: header wallet balance#479
Open
OG-wura wants to merge 1 commit into
Open
Conversation
|
@OG-wura is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@OG-wura 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.
Close #445
feat: header wallet balance
Summary
Adds a live wallet balance indicator to the app header that displays the connected Stellar account's native XLM balance with automatic polling.
Changes
New Files
hooks/useStellarBalance.hook.ts— Custom hook that fetches the native XLM balance from the Stellar Horizon API. Polls every 15 seconds while a wallet is connected. Returns{ balance, isLoading, error }. Handles 404 (unfunded accounts) gracefully by returning"0.0000000".components/navbar/WalletBalance.tsx— Presentational component that renders the balance as a pill in the header. Supports three states:1,250.50 XLM)••••with eye-off icon (respectsPrivacyContext.hideBalances)components/navbar/__tests__/WalletBalance.test.tsx— 9 unit tests covering all states (disconnected, loading, formatted display, zero balance, hide balances, null balance, custom class, large numbers, tiny numbers).Modified Files
components/navbar/Navbar.tsx— AddedWalletBalanceto the desktop header (next toWalletMenu) and mobile header (next to the avatar, hidden on small screens viahidden sm:flex).Testing
API / Visible Changes