-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29866 from software-mansion-labs/ts-migration/tes…
…t-tool-row-component [No QA][TS migration] Migrate 'TestToolRow.js' & 'Text' components to TypeScript
- Loading branch information
Showing
2 changed files
with
24 additions
and
36 deletions.
There are no files selected for viewing
14 changes: 6 additions & 8 deletions
14
src/components/TestToolRow.js → src/components/TestToolRow.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {View} from 'react-native'; | ||
import styles from '../styles/styles'; | ||
import Text from './Text'; | ||
|
||
const propTypes = { | ||
type TestToolRowProps = { | ||
/** Title of control */ | ||
title: PropTypes.string.isRequired, | ||
title: string; | ||
|
||
/** Control component jsx */ | ||
children: PropTypes.node.isRequired, | ||
children: React.ReactNode; | ||
}; | ||
|
||
function TestToolRow(props) { | ||
function TestToolRow({title, children}: TestToolRowProps) { | ||
return ( | ||
<View style={[styles.flexRow, styles.mb6, styles.justifyContentBetween, styles.alignItemsCenter, styles.mnw120]}> | ||
<View style={styles.flex2}> | ||
<Text>{props.title}</Text> | ||
<Text>{title}</Text> | ||
</View> | ||
<View style={[styles.flex1, styles.alignItemsEnd]}>{props.children}</View> | ||
<View style={[styles.flex1, styles.alignItemsEnd]}>{children}</View> | ||
</View> | ||
); | ||
} | ||
|
||
TestToolRow.propTypes = propTypes; | ||
TestToolRow.displayName = 'TestToolRow'; | ||
|
||
export default TestToolRow; |
This file contains 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