refactor(ProtectYourWalletModal): migrate to design system components#27584
Conversation
Convert class component to functional component with hooks. Replace View with Box, StyleSheet.create with twClassName, connect/HOC with useSelector/useDispatch/useAnalytics. Use DS Text, Icon, and Button components. Made-with: Cursor
|
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. |
Made-with: Cursor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27584 +/- ##
========================================
Coverage 82.34% 82.35%
========================================
Files 4787 4796 +9
Lines 123646 123796 +150
Branches 27511 27549 +38
========================================
+ Hits 101822 101955 +133
- Misses 14779 14785 +6
- Partials 7045 7056 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… with DS - Replace component-library Icon/ButtonVariants.Link with DS ButtonIcon and TextButton - Replace TouchableOpacity with DS ButtonIcon for close button - Remove useTailwind hook (no longer needed) - Fix arbitrary Tailwind bracket values (mt-[30px] → mt-8, w-[26px] → w-6) - Switch PNG require() to ES import to remove eslint-disable comment Made-with: Cursor
…and centering - Rename index.tsx back to index.js (keep all DS changes) - Replace TextButton with DS Button (ButtonVariant.Tertiary) per DS team guidance - Fix Learn more alignment with w-full twClassName - Add PropTypes for navigation prop Made-with: Cursor
…changes only Keep original PureComponent + connect() + withAnalyticsAwareness HOC structure. Replace only the visual layer with design system components: - View -> Box with twClassName - StyleSheet.create() -> removed (no more theme-based styles) - Raw Text -> DS Text with TextVariant/FontWeight/TextColor - FontAwesome Icon + TouchableOpacity -> DS ButtonIcon - TouchableOpacity + Text (learn more) -> DS Button (ButtonVariant.Tertiary) - Remove ThemeContext/mockTheme (DS handles theming internally) - Delete index.tsx Made-with: Cursor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - draft PR All E2E tests pre-selected. |
|
✅ E2E Fixture Validation — Schema is up to date |
|
|
@metamaskbot update-mobile-fixture |



Description
Replaces legacy styling and icon primitives in
ProtectYourWalletModalwith design system components, keeping the existingPureComponent+connect()+withAnalyticsAwarenessarchitecture unchanged.What changed (visual layer only):
View→Boxfrom@metamask/design-system-react-nativeStyleSheet.create()+ theme-based color styles →twClassNameTailwind utilities (DS handles theming internally)TextwithfontStyles→ DSTextwithTextVariant,TextColor,FontWeightFontAwesomeicon +TouchableOpacity(close button) → DSButtonIconTouchableOpacity+Text(Learn more) → DSButton(ButtonVariant.Tertiary)ThemeContext/mockThemeimports (no longer needed)fontStylesimport (no longer needed)require()+eslint-disablecomment → clean ES module importChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI refactor that replaces legacy styling/components with design-system
Box/Text/Buttonvariants while keeping the same navigation and analytics flows.Overview
Refactors
ProtectYourWalletModalto use MetaMask design-system components and Tailwind-styletwClassNamelayout instead of legacyStyleSheet+View/TouchableOpacity+ FontAwesome close icon.The modal’s structure is preserved (same cancel/confirm handlers, navigation targets, analytics events, and seedless-onboarding suppression), but the header close control is now a DS
ButtonIcon, the “Learn more” action is a DSButton(Tertiary), and the image is imported via ES module rather thanrequire().Written by Cursor Bugbot for commit 8571195. This will update automatically on new commits. Configure here.