feat: Convert GasEducationCarousel from JavaScript to TypeScript#2
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
Conversation
- Rename index.js to index.tsx - Replace PropTypes with TypeScript interface GasEducationCarouselProps - Add proper type annotations for state variables and callback functions - Update navigation typing to use NavigationProp<ParamListBase> - Add proper typing for Redux mapStateToProps using RootState - Update test file with proper TypeScript types and mock navigation - Fix all TypeScript compilation and ESLint errors Co-Authored-By: mason.batchelor@windsurf.com <mason.batchelor@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Convert GasEducationCarousel from JavaScript to TypeScript
Summary
Converted
app/components/Views/GasEducationCarousel/index.jsto TypeScript (.tsx) as part of the ongoing JavaScript to TypeScript migration in MetaMask Mobile. This change improves type safety and development experience while maintaining all existing functionality.Key Changes:
index.js→index.tsxGasEducationCarouselPropsuseState,useEffect)mapStateToPropsto useRootStatetypeNavigationProp<ParamListBase>Review & Testing Checklist for Human
navigation.pop()tonavigation.goBack())yarn test app/components/Views/GasEducationCarousel/to ensure updated test file passesyarn lint:tscto confirm no type errorsDiagram
%%{ init : { "theme" : "default" }}%% graph TD GasCarousel["app/components/Views/GasEducationCarousel/<br/>index.tsx"]:::major-edit GasTest["app/components/Views/GasEducationCarousel/<br/>index.test.tsx"]:::minor-edit ThemeModels["app/util/theme/models.ts<br/>(Colors type)"]:::context CurrencySelectors["app/selectors/currencyRateController.ts<br/>(RootState, selectors)"]:::context Reducers["app/reducers<br/>(RootState type)"]:::context Navigation["@react-navigation/native<br/>(NavigationProp)"]:::context GasCarousel -->|imports Colors type| ThemeModels GasCarousel -->|imports RootState| Reducers GasCarousel -->|uses navigation typing| Navigation GasCarousel -->|connects to Redux| CurrencySelectors GasTest -->|tests component| GasCarousel 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:#FFFFFFNotes
navigation.pop()withnavigation.goBack()to fix TypeScript compatibility - verify this doesn't change user experiencegetParamapproachRootStatetype from currency rate selectors for better type safetySession Info: Requested by @mbatchelor81
Devin Session: https://app.devin.ai/sessions/e3abd704f554465aa7da332166904ac7