diff --git a/src/components/ExceededCommentLength.js b/src/components/ExceededCommentLength.tsx similarity index 68% rename from src/components/ExceededCommentLength.js rename to src/components/ExceededCommentLength.tsx index 3fd6688944f7..6cd11cc44a5c 100644 --- a/src/components/ExceededCommentLength.js +++ b/src/components/ExceededCommentLength.tsx @@ -1,23 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; import Text from './Text'; -const propTypes = { - shouldShowError: PropTypes.bool.isRequired, -}; - -const defaultProps = {}; - -function ExceededCommentLength(props) { +function ExceededCommentLength() { const styles = useThemeStyles(); const {numberFormat, translate} = useLocalize(); - if (!props.shouldShowError) { - return null; - } return ( (phraseKey: TKey, ...phraseParameters: Localize.PhraseParameters>) => string; /** Formats number formatted according to locale and options */ - numberFormat: (number: number, options: Intl.NumberFormatOptions) => string; + numberFormat: (number: number, options?: Intl.NumberFormatOptions) => string; /** Converts a datetime into a localized string representation that's relative to current moment in time */ datetimeToRelative: (datetime: string) => string; diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose/ReportActionCompose.js index 396e94d9cf9d..b23d9b554488 100644 --- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.js @@ -446,7 +446,7 @@ function ReportActionCompose({ > {!isSmallScreenWidth && } - + {hasExceededMaxCommentLength && } diff --git a/src/pages/home/report/ReportActionItemMessageEdit.js b/src/pages/home/report/ReportActionItemMessageEdit.js index 3da0fad72f0a..41e411d398b8 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.js +++ b/src/pages/home/report/ReportActionItemMessageEdit.js @@ -475,7 +475,7 @@ function ReportActionItemMessageEdit(props) { - + {hasExceededMaxCommentLength && } ); }