Passing the comment down until we reach the queryData

This commit is contained in:
okbel
2018-03-01 16:47:15 -03:00
parent e055a3e4d4
commit 0055c82166
5 changed files with 10 additions and 2 deletions
@@ -661,6 +661,7 @@ export default class Comment extends React.Component {
{activeReplyBox === comment.id ? (
<ReplyBox
comment={comment}
commentPostedHandler={this.commentPostedHandler}
charCountEnable={charCountEnable}
maxCharCount={maxCharCount}
@@ -50,6 +50,7 @@ class CommentForm extends React.Component {
onCancel: PropTypes.func,
state: PropTypes.string,
loadingState: PropTypes.oneOf(['', 'loading', 'success', 'error']),
comment: PropTypes.object,
};
static get defaultProps() {
return {
@@ -87,6 +88,7 @@ class CommentForm extends React.Component {
charCountEnable,
body,
loadingState,
comment,
} = this.props;
const length = body.length;
@@ -104,6 +106,7 @@ class CommentForm extends React.Component {
return (
<div>
<DraftArea
comment={comment}
id={this.props.bodyInputId}
label={this.props.bodyLabel}
value={body}
@@ -27,10 +27,12 @@ class ReplyBox extends React.Component {
commentPostedHandler,
maxCharCount,
charCountEnable,
comment,
} = this.props;
return (
<div className={cn(styles.container, `${name}-textarea`)}>
<CommentBox
comment={comment}
maxCharCount={maxCharCount}
charCountEnable={charCountEnable}
commentPostedHandler={commentPostedHandler}
@@ -48,6 +50,7 @@ class ReplyBox extends React.Component {
}
ReplyBox.propTypes = {
comment: PropTypes.object,
charCountEnable: PropTypes.bool.isRequired,
maxCharCount: PropTypes.number,
setActiveReplyBox: PropTypes.func.isRequired,
@@ -146,7 +146,7 @@ class CommentBox extends React.Component {
};
render() {
const { isReply, maxCharCount, assetId, parentId } = this.props;
const { isReply, maxCharCount, assetId, parentId, comment } = this.props;
let { onCancel } = this.props;
if (isReply && typeof onCancel !== 'function') {
@@ -164,6 +164,7 @@ class CommentBox extends React.Component {
return (
<div>
<CommentForm
comment={comment}
defaultValue={this.props.defaultValue}
bodyLabel={isReply ? t('comment_box.reply') : t('comment.comment')}
maxCharCount={maxCharCount}
@@ -205,6 +206,7 @@ CommentBox.propTypes = {
canPost: PropTypes.bool,
notify: PropTypes.func.isRequired,
tags: PropTypes.array,
comment: PropTypes.object,
};
CommentBox.fragments = CommentForm.fragments;
@@ -36,7 +36,6 @@ class Editor extends React.Component {
},
});
console.log('comment', this.props.comment);
// To edit comments and have the previous html comment
if (this.props.comment && this.props.comment.richTextBody) {
this.ref.content.innerHTML = this.props.comment.richTextBody;