Fix XNT balance display, send validation, and improve UI notifications - #20
Closed
stackedPenguin wants to merge 6 commits into
Closed
Fix XNT balance display, send validation, and improve UI notifications#20stackedPenguin wants to merge 6 commits into
stackedPenguin wants to merge 6 commits into
Conversation
- Add custom launcher icons from AppIcons source - Added ic_launcher.png and ic_launcher_round.png for all densities - Removed adaptive icon XMLs and webp files to use PNG icons directly - Replace safe area context with updated version - Installed react-native-safe-area-context from @AppAndFlow/react-native-safe-area-context - Implemented useSafeAreaInsets hook in bottom navigation - Fixed bottom tab bar overlapping with system UI on devices with gesture navigation - Update .gitignore to track app icon resources - Configured selective tracking of android/app/src/main/res/mipmap-*/ directories - Ensures custom app icons are version controlled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…raffic Root cause: Android 9+ blocks cleartext HTTP traffic by default. The app's API server uses HTTP (http://162.250.126.66:4000), causing all network requests to fail with "Network request failed". Changes: - Added android:usesCleartextTraffic="true" to AndroidManifest.xml to allow HTTP connections to the API server - Added comprehensive debug logging throughout wallet loading, balance fetching, and transaction retrieval flows - Updated .gitignore to track AndroidManifest.xml for future changes - Debug logs now always captured (not just when debug drawer is open) The app now successfully: - Loads wallets from storage after unlock - Fetches balance data from API - Fetches transaction history - Registers wallets with the indexer - Displays XNT token balance and USD value Note: The AndroidManifest.xml file is in android/android/ which is gitignored. Manual change required: Add android:usesCleartextTraffic="true" to the <application> tag in android/android/app/src/main/AndroidManifest.xml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit fixes two critical bugs in the send transaction flow: 1. Send Transaction Validation Error - Fixed handleSendSubmit to accept parameters from SendScreen - Changed validation to check passed parameters instead of stale App.js state - SendScreen's local state now properly syncs with handleSendSubmit - Added state storage after validation for confirmation screen 2. Address Selector Not Working - Added selectedAddressForSend state for screen communication - Connected AddressSelectorScreen with wallets prop and onSelect callback - SendScreen now receives selected address and updates input field via useEffect - Fixed AddressSelectorScreen to display wallet.publicKey instead of wallet.address - Clear selected address when opening send sheet to prevent stale selections Both issues stemmed from state synchronization problems where child components maintained local state that wasn't properly communicated to parent handlers. Files changed: - App.js: Added selectedAddressForSend state, updated handleSendSubmit signature, connected AddressSelectorScreen props, clear state on send sheet open - screens/SendScreen.js: Added useEffect to sync selected address from prop - screens/AddressSelectorScreen.js: Fixed to use wallet.publicKey property
Merged changes from feat/add-custom-app-icons-fix-safe-area: - Added custom launcher icons (PNG format) for all density variants - Upgraded safe area context package for better bottom navigation handling - Updated .gitignore to track both AndroidManifest.xml and app icons Resolved conflicts in .gitignore by combining both approaches: - Track AndroidManifest.xml for cleartext traffic configuration - Track mipmap-*/ directories for custom app icons
Improved UI/UX by replacing default React Native Alert dialogs with react-native-toast-message for a more modern and polished look. Changes: - Installed react-native-toast-message package - Created custom toast configuration matching the dark theme - Replaced simple notification Alerts with toasts: - Success messages (copied address, wallet deleted) - Error messages (validation errors, invalid inputs) - Info messages (swap, stake, bridge placeholders) - Kept confirmation dialogs as Alert.alert for user decisions - Custom toast styles: - Dark background (#1a1a1a) - Color-coded left border (green for success, red for error, blue for info) - Rounded corners and shadow for depth - Bottom positioning for non-intrusive display The toasts provide better visual feedback with automatic dismissal and don't block the UI like traditional alerts.
Enhanced toast notifications to work better with devices that have
software navigation buttons and provide better readability.
Changes:
- Added bottomOffset={80} to position toasts 80px above the bottom
This ensures toasts don't overlap with software navigation keys
- Increased padding:
- paddingVertical: 18 (was 16)
- paddingHorizontal: 20 (was 16)
- Improved margins:
- marginHorizontal: 20 (was 16) for more breathing room
- marginBottom: 8 (new) for spacing between multiple toasts
- Better text spacing:
- marginBottom: 6 between title and subtitle (was 4)
- lineHeight: 18 for improved text readability
The toasts now appear comfortably above the navigation bar with
better visual spacing and readability.
jacklevin74
pushed a commit
that referenced
this pull request
Nov 17, 2025
Add app icons and update screens Co-Authored-By: Claude <noreply@anthropic.com>
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 fixes critical bugs preventing XNT balance and transaction display, resolves send transaction validation issues, and significantly improves the UI with modern toast notifications.
Bug Fixes
🐛 Fix #1: XNT Balance and Transactions Not Displaying
Problem: Despite successful wallet creation, XNT balance showed $0.00 and no transactions appeared.
Root Cause: Android 9+ blocks cleartext HTTP traffic by default. The API server uses HTTP (http://162.250.126.66:4000), causing all fetch requests to fail silently with "Network request failed".
Solution:
android:usesCleartextTraffic="true"to AndroidManifest.xmlFiles Changed:
android/app/src/main/AndroidManifest.xml.gitignoreApp.js(debug logging)🐛 Fix #2: Send Transaction Validation Error
Problem: "Please enter both address and amount" error appeared even when both fields were filled.
Root Cause: State synchronization mismatch between SendScreen and App.js. SendScreen maintained local state but App.js wasn't receiving those values -
handleSendSubmitwas checking stale App.js state instead of the form values.Solution:
handleSendSubmitto accept parameters:handleSendSubmit(amount, address)Files Changed:
App.js(App.js:1258)screens/SendScreen.js🐛 Fix #3: Address Selector Not Working
Problem: "Select Address" button showed empty list and selecting addresses didn't populate the send field.
Root Cause: AddressSelectorScreen was missing
walletsandonSelectprops, and was trying to displaywallet.addressinstead ofwallet.publicKey.Solution:
selectedAddressForSendstate for screen communicationwalletsprop andonSelectcallbackuseEffectwallet.publicKeyFiles Changed:
App.js(state management and prop passing)screens/SendScreen.js(useEffect for address syncing)screens/AddressSelectorScreen.js(property fix)UI/UX Improvements
🎨 Modern Toast Notifications
Replaced default React Native Alert dialogs with beautiful, non-intrusive toast notifications using
react-native-toast-message.Features:
Replaced Alerts:
Benefits:
Files Changed:
App.js(Toast configuration and replacement of Alert.alert calls)package.json(added react-native-toast-message)🎨 Merged PR #19: Custom App Icons and Safe Area Fix
Testing
Screenshots
[The app now displays XNT balances correctly, has improved send validation, and shows beautiful toast notifications]
Technical Details
API Changes
Dependencies Added
react-native-toast-message: Modern toast notification libraryPerformance Impact
Checklist
Generated with Claude Code