refactor(analytics): PR E4 migrate TradeTabBarItem from useMetrics to useAnalytics#30501
Conversation
… useAnalytics Replaces useMetrics with useAnalytics in TradeTabBarItem.tsx and updates the MetaMetricsEvents import to come directly from core/Analytics. Part of analytics cleanup workstream (#26686). Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
TradeTabBarItem is used in TabBarItem (navigation component), which is used in trading-related views including Perps, Predictions, and Swap flows. Since this component is part of the navigation bar for trading features, tests covering those flows should be run to verify the analytics refactoring doesn't break anything. Per tag descriptions:
The risk is low since this is purely a refactoring with no behavioral change, but we should validate the analytics hook swap doesn't cause runtime errors in the affected flows. Performance Test Selection: |
|



Description
Part of the analytics cleanup workstream (#26686).
Migrates
TradeTabBarItemfrom the deprecateduseMetricstouseAnalytics. Moves theMetaMetricsEventsimport from theuseMetricsbarrel tocore/Analyticsdirectly, consistent with other already-migrated components.Files touched:
TradeTabBarItem/TradeTabBarItem.tsx— replaceuseMetricsimport withuseAnalytics, moveMetaMetricsEventsimport tocore/AnalyticsChangelog
CHANGELOG entry: null
Related issues
Closes: #30514
Refs: #26686
Manual testing steps
N/A
Screenshots/Recordings
Before
N/A — no UI changes.
After
N/A — no UI changes.
Pre-merge author checklist
Pre-merge reviewer checklist