refactor(unstake): use HeaderStandard instead of getStakingNavbar#30281
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30281 +/- ##
==========================================
+ Coverage 81.92% 81.95% +0.02%
==========================================
Files 5442 5446 +4
Lines 145329 145468 +139
Branches 33217 33232 +15
==========================================
+ Hits 119064 119221 +157
+ Misses 18135 18113 -22
- Partials 8130 8134 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…github.com:MetaMask/metamask-mobile into wsun/changing-unstake-screen-to-use-headerstandard
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Why SmokeStake: This tag directly covers lending withdrawals ( Why SmokeConfirmations: Per the SmokeStake tag description, "When selecting SmokeStake, also select SmokeConfirmations (transaction confirmations are part of the flow)." The withdrawal flow leads to transaction confirmations. No other tags are needed as the changes are isolated to the Earn/Stake withdrawal input screen and don't touch shared navigation, browser, accounts, or other wallet features. Performance Test Selection: |
|



Description
Note to reviewer: please use this link to check the difference to avoid formatting noise: https://github.com/MetaMask/metamask-mobile/pull/30281/changes?w=1
Refactors the Earn withdraw/unstake input header to use reusable, design-system components and consolidates analytics wiring.
Why
What changed
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
isStablecoinLendingEnabled: true and USDC (withdraw)
isStablecoinLendingEnable: false and USDC (withdraw)
isStablecoinLendingEnable: true and ETH (unstake)
isStablecoinLendingENabled: false and ETH (unstake)
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Moderate UI/navigation refactor that replaces the React Navigation header for the withdraw/unstake flow; risk is mainly around incorrect header buttons or analytics events firing on back/cancel across staking, lending, and Tron variants.
Overview
Refactors the Earn withdraw/unstake input header to render an in-screen design-system
HeaderStandardinstead of usingnavigation.setOptions(getStakingNavbar(...)). The header now supports a reusable subtitle (EarnHeaderSubtitle) that displays receipt-token balance + APR (with optional Tron APR override), and wires back/cancel presses to emit the same MetaMetrics events before callingnavigation.goBack().Tests were updated to assert header text/buttons via new test IDs and to verify back/cancel tracking +
goBackbehavior, and the staking stack route forRoutes.STAKING.UNSTAKEnow setsoptions={{ headerShown: false }}to avoid the native header. Minor styling was added to accommodate headers with subtitles (headerWithSubtitle).Reviewed by Cursor Bugbot for commit 247f166. Bugbot is set up for automated code reviews on this repo. Configure here.