Skip to content

refactor(ProtectYourWalletModal): migrate to design system components#27584

Merged
tylerc-consensys merged 6 commits into
mainfrom
tylerchong/ds-migrate-protect-wallet-modal
Mar 20, 2026
Merged

refactor(ProtectYourWalletModal): migrate to design system components#27584
tylerc-consensys merged 6 commits into
mainfrom
tylerchong/ds-migrate-protect-wallet-modal

Conversation

@tylerc-consensys

@tylerc-consensys tylerc-consensys commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Description

Replaces legacy styling and icon primitives in ProtectYourWalletModal with design system components, keeping the existing PureComponent + connect() + withAnalyticsAwareness architecture unchanged.

What changed (visual layer only):

  • ViewBox from @metamask/design-system-react-native
  • StyleSheet.create() + theme-based color styles → twClassName Tailwind utilities (DS handles theming internally)
  • Raw Text with fontStyles → DS Text with TextVariant, TextColor, FontWeight
  • FontAwesome icon + TouchableOpacity (close button) → DS ButtonIcon
  • TouchableOpacity + Text (Learn more) → DS Button (ButtonVariant.Tertiary)
  • Remove ThemeContext / mockTheme imports (no longer needed)
  • Remove fontStyles import (no longer needed)
  • PNG require() + eslint-disable comment → clean ES module import

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: Protect Your Wallet Modal — visual regression check

  Scenario: Modal renders correctly (light + dark mode)
    Given the user has a wallet without a backed-up seed phrase
    When the wallet home screen loads
    Then the Protect Your Wallet modal appears
    And the title, lock image, body text, close button, and Learn more button are visible
    And the layout matches the before/after screenshots in both light and dark mode

  Scenario: All interactions still work
    Given the modal is visible
    When user taps the X close button — modal dismisses
    When user taps "Protect wallet" — navigates to backup SRP flow
    When user taps "Learn more" — opens MetaMask safety tips webview
    When user taps "Remind me later" — modal dismisses
Before After
Light
Dark

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk UI refactor that replaces legacy styling/components with design-system Box/Text/Button variants while keeping the same navigation and analytics flows.

Overview
Refactors ProtectYourWalletModal to use MetaMask design-system components and Tailwind-style twClassName layout instead of legacy StyleSheet + 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 DS Button (Tertiary), and the image is imported via ES module rather than require().

Written by Cursor Bugbot for commit 8571195. This will update automatically on new commits. Configure here.

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
@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-onboarding Onboarding team label Mar 18, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk size-M labels Mar 18, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 18, 2026
@codecov-commenter

codecov-commenter commented Mar 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.35%. Comparing base (eb832ce) to head (8571195).
⚠️ Report is 13 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 18, 2026
@tylerc-consensys tylerc-consensys removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 20, 2026
@tylerc-consensys tylerc-consensys self-assigned this Mar 20, 2026
… 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
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 20, 2026
…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
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - draft PR

All E2E tests pre-selected.

View GitHub Actions results

@tylerc-consensys tylerc-consensys marked this pull request as ready for review March 20, 2026 08:40
@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
15 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

@tylerc-consensys

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

@smgv smgv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tylerc-consensys tylerc-consensys added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 22f9bd9 Mar 20, 2026
213 of 216 checks passed
@tylerc-consensys tylerc-consensys deleted the tylerchong/ds-migrate-protect-wallet-modal branch March 20, 2026 11:56
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 20, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants