When max char count is disabled, allow posting long comments in CommentBox

This commit is contained in:
Benjamin Goering
2017-05-03 19:41:29 -07:00
parent 9b94406763
commit 636d29af9f
+2 -2
View File
@@ -90,12 +90,12 @@ export class CommentForm extends React.Component {
saveComment({body});
}
render() {
const {maxCharCount, styles, saveCommentEnabled, buttonClass} = this.props;
const {maxCharCount, styles, saveCommentEnabled, buttonClass, charCountEnable} = this.props;
const body = this.state.body;
const length = body.length;
const isNotValidLength = (length) => !length || (maxCharCount && length > maxCharCount);
const disablePostComment = isNotValidLength(length) || ! saveCommentEnabled({body});
const disablePostComment = (charCountEnable && isNotValidLength(length)) || ! saveCommentEnabled({body});
return <div>
<div className={`${name}-container`}>