From 4f5c4d30f3b3e4e290b1e456f0779fb8e704c919 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 06:25:06 +0000 Subject: [PATCH 1/3] Convert ModalNavbarTitle component to TypeScript --- app/components/UI/ModalNavbarTitle/index.tsx | 36 ++++++++++++++++++++ notes.md | 21 ++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 app/components/UI/ModalNavbarTitle/index.tsx create mode 100644 notes.md diff --git a/app/components/UI/ModalNavbarTitle/index.tsx b/app/components/UI/ModalNavbarTitle/index.tsx new file mode 100644 index 00000000000..5b4f5facb68 --- /dev/null +++ b/app/components/UI/ModalNavbarTitle/index.tsx @@ -0,0 +1,36 @@ +import React, { PureComponent } from 'react'; +import { View, StyleSheet, Text } from 'react-native'; +import { fontStyles } from '../../../styles/common'; + +const styles = StyleSheet.create({ + wrapper: { + alignItems: 'center', + flex: 1, + }, + title: { + fontSize: 18, + ...fontStyles.normal, + }, +}); + +interface ModalNavbarTitleProps { + /** + * Name of the current view + */ + title: string; +} + +/** + * UI PureComponent that renders inside the modal navbar + */ +//DEVIN_TODO: Verify if PureComponent needs type parameters +export default class ModalNavbarTitle extends PureComponent { + render = () => { + const { title } = this.props; + return ( + + {title} + + ); + }; +} diff --git a/notes.md b/notes.md new file mode 100644 index 00000000000..e7b304bdf97 --- /dev/null +++ b/notes.md @@ -0,0 +1,21 @@ +# ModalNavbarTitle Component TypeScript Conversion + +## Confirmed Types +- [x] `title` prop: `string` (required) + +## To Investigate +- [ ] Check if any additional props or context are used +- [ ] Verify if `PureComponent` needs type parameters +- [ ] Determine if `styles` object needs typing + +## Conversion Tasks +- [ ] Create interface for component props +- [ ] Remove `propTypes` after conversion +- [ ] Update class declaration to use TypeScript syntax +- [ ] Check for any implicit 'any' types + +## Notes +- Component is a `PureComponent` from React +- Uses `StyleSheet` from react-native for styling +- `render` method destructures `title` from `this.props` +- Remember to use `interface` for props definition From eea7e70c1c9eb0d9374e1c598ae5d0bb5ad4769e Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 06:25:24 +0000 Subject: [PATCH 2/3] Remove index.js after conversion to TypeScript --- app/components/UI/ModalNavbarTitle/index.js | 36 --------------------- 1 file changed, 36 deletions(-) delete mode 100644 app/components/UI/ModalNavbarTitle/index.js diff --git a/app/components/UI/ModalNavbarTitle/index.js b/app/components/UI/ModalNavbarTitle/index.js deleted file mode 100644 index 1583a4a5dbf..00000000000 --- a/app/components/UI/ModalNavbarTitle/index.js +++ /dev/null @@ -1,36 +0,0 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; -import { View, StyleSheet, Text } from 'react-native'; -import { fontStyles } from '../../../styles/common'; - -const styles = StyleSheet.create({ - wrapper: { - alignItems: 'center', - flex: 1, - }, - title: { - fontSize: 18, - ...fontStyles.normal, - }, -}); - -/** - * UI PureComponent that renders inside the modal navbar - */ -export default class ModalNavbarTitle extends PureComponent { - static propTypes = { - /** - * Name of the current view - */ - title: PropTypes.string.isRequired, - }; - - render = () => { - const { title } = this.props; - return ( - - {title} - - ); - }; -} From 72ff1ae11debee4d330e2bcd45b8864e57e728a5 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 07:01:28 +0000 Subject: [PATCH 3/3] Remove DEVIN_TODO comment from ModalNavbarTitle component --- app/components/UI/ModalNavbarTitle/index.tsx | 1 - notes.md | 21 -------------------- 2 files changed, 22 deletions(-) delete mode 100644 notes.md diff --git a/app/components/UI/ModalNavbarTitle/index.tsx b/app/components/UI/ModalNavbarTitle/index.tsx index 5b4f5facb68..d58bab49e82 100644 --- a/app/components/UI/ModalNavbarTitle/index.tsx +++ b/app/components/UI/ModalNavbarTitle/index.tsx @@ -23,7 +23,6 @@ interface ModalNavbarTitleProps { /** * UI PureComponent that renders inside the modal navbar */ -//DEVIN_TODO: Verify if PureComponent needs type parameters export default class ModalNavbarTitle extends PureComponent { render = () => { const { title } = this.props; diff --git a/notes.md b/notes.md deleted file mode 100644 index e7b304bdf97..00000000000 --- a/notes.md +++ /dev/null @@ -1,21 +0,0 @@ -# ModalNavbarTitle Component TypeScript Conversion - -## Confirmed Types -- [x] `title` prop: `string` (required) - -## To Investigate -- [ ] Check if any additional props or context are used -- [ ] Verify if `PureComponent` needs type parameters -- [ ] Determine if `styles` object needs typing - -## Conversion Tasks -- [ ] Create interface for component props -- [ ] Remove `propTypes` after conversion -- [ ] Update class declaration to use TypeScript syntax -- [ ] Check for any implicit 'any' types - -## Notes -- Component is a `PureComponent` from React -- Uses `StyleSheet` from react-native for styling -- `render` method destructures `title` from `this.props` -- Remember to use `interface` for props definition