Skip to content

Commit

Permalink
Migrate ReportActionItemBasicMessage.js to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
JKobrynski committed Dec 1, 2023
1 parent dad6391 commit 545f4af
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
import PropTypes from 'prop-types';
import React from 'react';
import {View} from 'react-native';
import Text from '@components/Text';
import useThemeStyles from '@styles/useThemeStyles';
import ChildrenProps from '@src/types/utils/ChildrenProps';

const propTypes = {
message: PropTypes.string.isRequired,
children: PropTypes.element,
type ReportActionItemBasicMessageProps = ChildrenProps & {
message: string;
};

const defaultProps = {
children: null,
};

function ReportActionItemBasicMessage(props) {
function ReportActionItemBasicMessage({message, children}: ReportActionItemBasicMessageProps) {
const styles = useThemeStyles();
return (
<View>
<Text style={[styles.chatItemMessage, styles.colorMuted]}>{props.message}</Text>
{props.children}
<Text style={[styles.chatItemMessage, styles.colorMuted]}>{message}</Text>
{children}
</View>
);
}

ReportActionItemBasicMessage.propTypes = propTypes;
ReportActionItemBasicMessage.defaultProps = defaultProps;
ReportActionItemBasicMessage.displayName = 'ReportActionBasicMessage';

export default ReportActionItemBasicMessage;

0 comments on commit 545f4af

Please sign in to comment.