Skip to content

Commit

Permalink
fix: remove shouldShowError
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszGrajdek committed Dec 18, 2023
1 parent 285b87a commit eae6241
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions src/components/ExceededCommentLength.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
import Text from './Text';

type ExceededCommentLengthProps = {
/** Show error when comment length is exceeded */
shouldShowError: boolean;
};

function ExceededCommentLength({shouldShowError}: ExceededCommentLengthProps) {
function ExceededCommentLength() {
const styles = useThemeStyles();
const {numberFormat, translate} = useLocalize();

if (!shouldShowError) {
return null;
}

return (
<Text
style={[styles.textMicro, styles.textDanger, styles.chatItemComposeSecondaryRow, styles.mlAuto, styles.pl2]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ function ReportActionCompose({
>
{!isSmallScreenWidth && <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />}
<ReportTypingIndicator reportID={reportID} />
<ExceededCommentLength shouldShowError={hasExceededMaxCommentLength} />
{hasExceededMaxCommentLength && <ExceededCommentLength/>}
</View>
</OfflineWithFeedback>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ function ReportActionItemMessageEdit(props) {
</View>
</View>
</View>
<ExceededCommentLength shouldShowError={hasExceededMaxCommentLength} />
{hasExceededMaxCommentLength && <ExceededCommentLength/>}
</>
);
}
Expand Down

0 comments on commit eae6241

Please sign in to comment.