MetaMask / MetaMask/metamask-mobile
Replace deprecated Text component with Text from @metamask/design-system-react-native
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
### **Description**
There are many instances in the mobile codebase where outdated `Text` components are still being used. These should be gradually replaced with the `Text` component from `@metamask/design-system-react-native`.
**Deprecated sources to replace:**
1. `app/components/Base/Text/Text.tsx` – Legacy component with boolean props (bold, centered, muted, small, etc.)
2. `app/component-library/components/Texts/Text/Text.tsx` – Component-library version with variant, color, style props (now deprecated in favor of the design system)
To ensure manageable code reviews and reduce the potential for regressions, **each pull request (PR) should focus on replacing a small number of instances** (e.g. 1–5 files per code owner). This incremental approach helps with gradual adoption and easier validation.
### **Technical Details**
- Locate and replace instances of the deprecated `Text` components (Base/Text or component-library Text).
- Use the `Text` component from `@metamask/design-system-react-native` and ensure all props and logic are appropriately migrated.
- Reference: https://github.com/MetaMask/metamask-design-system/blob/main/packages/design-system-react-native/MIGRATION.md#text-component
- The component APIs differ slightly, so confirm compatibility and visual/functional parity.
- Validate that there are no regressions after the change.
### **Acceptance Criteria**
- Deprecated `Text` components (from Base/Text or component-library) are replaced with the design system version.
- The new `Text` component from `@metamask/design-system-react-native` is implemented with the correct props and behavior.
- There are no visual or functional regressions.
- All Jest tests, e2e tests, linting, and Storybook must pass.
- PR includes before and after UI screenshots to confirm visual consistency.
PRs that do not follow this guidance may be closed or requested to be revised.
### **Difficulty**: Intermediate
**Good first issue for:** External contributors who are comfortable running mobile locally and are familiar with React Native, component props, testing, and UI consistency best practices.
Contributor guide
Research direction
Start by reading app/components/Base/Text/Text.tsx, app/component-library/components/Texts/Text/Text.tsx, and the linked Text migration guide. Locate a small set of mobile usages, migrate them to the design-system Text with equivalent behavior, then validate with Jest, e2e tests, linting, Storybook, and before/after screenshots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- frontend, mobile
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100