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/Swaps/components/Ratio.js to TypeScript #11311

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

devin-ai-integration[bot]
Copy link
Contributor

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

Convert app/components/UI/Swaps/components/Ratio.js to TypeScript

Changes Made

  • Converted Ratio.js to Ratio.tsx
  • Removed PropTypes and added TypeScript interfaces
  • Updated to use ThemeColors from @metamask/design-tokens
  • Added type annotations for variables and function return types
  • Imported BigNumber from bignumber.js for ratio type

Key Updates

  1. Created interfaces for TokenInfo and RatioProps
  2. Added type annotations for useState, useRatio, and handleRatioSwitch
  3. Updated createStyles function to use ThemeColors type
  4. Removed PropTypes validation at the end of the file

Reviewer Notes

  • Please check if the TokenInfo interface covers all necessary properties
  • Verify if the RatioProps interface includes all required props
  • Confirm that the ThemeColors import path is correct for the project structure

Testing

No functional changes were made, so existing tests should cover the component's behavior. However, please run the test suite to ensure no regressions.

Link to Devin run: https://preview.devin.ai/devin/33c5d255eb1e4c069d2167b05f5abbe4

This Devin run was requested by Sampriti.

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

app/components/UI/Swaps/components/Ratio.tsx Outdated Show resolved Hide resolved
app/components/UI/Swaps/components/Ratio.tsx Outdated Show resolved Hide resolved
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 enabled auto-merge September 23, 2024 23:45
Copy link

@Cal-L Cal-L added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit 2eb1116 Sep 24, 2024
36 checks passed
@Cal-L Cal-L deleted the convert-ts-Ratio-945 branch September 24, 2024 00:04
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Sep 24, 2024
@metamaskbot metamaskbot added the release-7.33.0 Issue or pull request that will be included in release 7.33.0 label Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.33.0 Issue or pull request that will be included in release 7.33.0 team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants