Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(js-ts): Convert app/components/UI/ConnectHeader/index.js to TypeScript #11274

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Sep 18, 2024

Pull Request: Convert app/components/UI/ConnectHeader/index.js to TypeScript

Description

This PR converts the ConnectHeader component from JavaScript to TypeScript as part of our ongoing effort to improve type safety and maintainability in the MetaMask Mobile codebase.

Changes Made

  • Converted app/components/UI/ConnectHeader/index.js to TypeScript (renamed to index.tsx)
  • Removed PropTypes and replaced with TypeScript interface
  • Added type annotations for functions and variables
  • Resolved TypeScript errors related to ThemeColors and createStyles function
  • Converted class component to functional component using React hooks

Key Implementation Details

  • Used interface for props instead of type
  • Avoided using 'any' type and explicit type annotations unless necessary
  • Utilized the Colors type from app/util/theme/models for proper typing of the createStyles function
  • Ensured compatibility with existing ThemeContext and mockTheme usage
  • Verified that TextVariant usage (specifically TextVariant.HeadingSMRegular) is correct

Verification Steps

  • Ran yarn tsc to check for TypeScript errors (passed)
  • Ran yarn lint to check for linting issues (passed with some warnings in other files)

Related Issues

N/A

Additional Notes

This PR is part of the ongoing JavaScript to TypeScript conversion effort. It improves type safety and maintainability of the ConnectHeader component without changing its functionality.

Devin Run Information

If you have any feedback, you can leave comments in the PR and I'll address them in the app!

@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner September 18, 2024 08:03
Copy link
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.

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

Left a comment

app/components/UI/ConnectHeader/index.tsx Outdated Show resolved Hide resolved
app/components/UI/ConnectHeader/index.tsx Outdated Show resolved Hide resolved
Copy link

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@Cal-L Cal-L added this pull request to the merge queue Sep 23, 2024
@Cal-L Cal-L added the team-ai AI team (for the Devin AI bot) label Sep 23, 2024
Merged via the queue into main with commit 1ef42ef Sep 23, 2024
37 of 39 checks passed
@Cal-L Cal-L deleted the convert-ts-ConnectHeader-577 branch September 23, 2024 20:25
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2024
@metamaskbot metamaskbot added the release-7.33.0 Issue or pull request that will be included in release 7.33.0 label Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.33.0 Issue or pull request that will be included in release 7.33.0 team-ai AI team (for the Devin AI bot)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants