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/BlockingActionModal/index.js to TypeScript #11308

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

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

Convert app/components/UI/BlockingActionModal/index.js to TypeScript

Changes Made

  • Renamed index.js to index.tsx
  • Removed PropTypes import and prop type definitions
  • Defined BlockingActionModalProps interface for component props
  • Added type annotations for function parameters and variables
  • Imported Theme type from '../../../util/theme/models'
  • Added type for colors parameter in createStyles function
  • Made onAnimationCompleted prop optional to maintain compatibility
  • Reverted changes to ConnectQRHardware/index.tsx

Motivation

This change is part of our ongoing effort to migrate the codebase to TypeScript, improving type safety and developer experience.

Context

The BlockingActionModal component is used in various parts of the application to display a modal with a loading spinner. Converting it to TypeScript will help catch potential type-related errors and improve code maintainability.

Related Issues

N/A

Manual Testing Steps

  1. Verify that the BlockingActionModal component still functions correctly in all places it's used.
  2. Check that the loading spinner appears when isLoadingAction is true.
  3. Ensure that the modal shows and hides properly based on the modalVisible prop.

Notes

  • The onAnimationCompleted prop was made optional to avoid unnecessary modifications to other files using this component.
  • No changes were required in the component's logic or styling.
  • Changes to ConnectQRHardware/index.tsx have been reverted to ensure this PR only contains intended changes related to the BlockingActionModal component.
  • The scope of this PR is limited to the TypeScript conversion of BlockingActionModal.

This Devin run was requested by Sampriti

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

@devin-ai-integration devin-ai-integration bot added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-platform No QA Needed Apply this label when your PR does not need any QA effort. labels Sep 18, 2024
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

import { ActivityIndicator, StyleSheet, View } from 'react-native';
import Modal from 'react-native-modal';
import { baseStyles } from '../../../styles/common';
import { useTheme } from '../../../util/theme';
import { Theme } from '../../../util/theme/models';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { Theme } from '../../../util/theme/models';
import { Theme } from '@metamask/design-tokens';

Copy link

sonarcloud bot commented Sep 19, 2024

@sethkfman sethkfman added team-ai AI team (for the Devin AI bot) and removed team-mobile-platform labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) No QA Needed Apply this label when your PR does not need any QA effort. team-ai AI team (for the Devin AI bot)
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

2 participants