Skip to content

Comments

feat: migrate AppInformation component from JS to TSX#3

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1755819729-migrate-appinformation-js-to-tsx
Open

feat: migrate AppInformation component from JS to TSX#3
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1755819729-migrate-appinformation-js-to-tsx

Conversation

@devin-ai-integration
Copy link

feat: migrate AppInformation component from JS to TSX

Summary

Migrated the AppInformation component from JavaScript to TypeScript as part of the ongoing JS→TS migration in the MetaMask Mobile codebase. This change adds strict type checking to a settings screen component that displays app information and provides navigation to various MetaMask resources.

Key changes:

  • Renamed app/components/Views/Settings/AppInformation/index.jsindex.tsx
  • Added TypeScript interfaces AppInformationProps and AppInformationState
  • Replaced PropTypes validation with TypeScript type annotations
  • Added return type annotations for all class methods
  • Updated test file to use renderWithProvider with mock navigation instead of renderScreen
  • Fixed undefined styles.links references that were causing runtime errors

Review & Testing Checklist for Human

  • Test all navigation links in the AppInformation screen - verify Privacy Policy, Terms of Use, Attributions, Support Center, Website, and Contact Us all navigate correctly
  • Verify visual layout is unchanged - check that the screen looks identical to before, especially the link sections
  • Run the component test - ensure yarn test app/components/Views/Settings/AppInformation/index.test.tsx passes and provides meaningful coverage
  • Check TypeScript compilation - run yarn lint:tsc to ensure no new TypeScript errors were introduced across the codebase

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    A["app/components/Views/Settings<br/>AppInformation/index.tsx"]:::major-edit --> B["React Navigation<br/>NavigationProp"]:::context
    A --> C["app/util/theme/models.ts<br/>Theme interface"]:::context
    A --> D["app/components/Views/Settings<br/>AppInformation/index.test.tsx"]:::major-edit
    D --> E["app/util/test<br/>renderWithProvider"]:::context
    A --> F["createStyles function<br/>(colors: any)"]:::minor-edit
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Context/No Edit]:::context
    end

classDef major-edit fill:#90EE90
classDef minor-edit fill:#87CEEB
classDef context fill:#FFFFFF
Loading

Notes

Potential concerns to watch for:

  • The navigation prop typing uses NavigationProp<ParamListBase> which should work but may need refinement if the actual navigation type is more specific
  • Test methodology changed from renderScreen (which provides real navigation context) to renderWithProvider with mocked navigation - this is more isolated but might miss integration issues
  • Used any type for the colors parameter in createStyles - this maintains functionality but reduces type safety

Link to Devin run: https://app.devin.ai/sessions/8c4b14ce3a794e4fa91c3a6200d9586b
Requested by: @mbatchelor81

- Rename index.js to index.tsx
- Add TypeScript interfaces for AppInformationProps and AppInformationState
- Replace PropTypes with TypeScript type annotations
- Add proper typing for navigation prop using NavigationProp<ParamListBase>
- Add return type annotations for all methods
- Update test file to use renderWithProvider with mock navigation
- Maintain existing functionality while improving type safety

Co-Authored-By: mason.batchelor@windsurf.com <mason.batchelor@windsurf.com>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants