diff --git a/docs/widget/src/components/CommentItem.js b/docs/widget/src/components/CommentItem.js index cd194f5..e1f660a 100644 --- a/docs/widget/src/components/CommentItem.js +++ b/docs/widget/src/components/CommentItem.js @@ -231,7 +231,9 @@ export class CommentItem extends Component { submitting: this.props.submitting, adminEmail: this.props.adminEmail, adminBadge: this.props.adminBadge, + enableCommentLike: this.props.enableCommentLike, onReply: this.props.onReply, + onLikeComment: this.props.onLikeComment, onSubmitReply: this.props.onSubmitReply, onCancelReply: this.props.onCancelReply, onUpdateReplyContent: this.props.onUpdateReplyContent, @@ -304,7 +306,9 @@ export class CommentItem extends Component { replyingTo: this.props.replyingTo, replyContent: this.props.replyContent, replyError: this.props.replyError, - submitting: this.props.submitting + submitting: this.props.submitting, + enableCommentLike: this.props.enableCommentLike, + onLikeComment: this.props.onLikeComment }); }); } diff --git a/docs/widget/src/components/CommentList.js b/docs/widget/src/components/CommentList.js index e81351e..0a98ae8 100644 --- a/docs/widget/src/components/CommentList.js +++ b/docs/widget/src/components/CommentList.js @@ -103,7 +103,7 @@ export class CommentList extends Component { onCancelReply: () => this.handleCancelReply(), onUpdateReplyContent: (content) => this.handleUpdateReplyContent(content), onClearReplyError: () => this.handleClearReplyError(), - onLikeComment: (commentId) => this.handleLikeComment(commentId) + onLikeComment: (commentId, isLike) => this.handleLikeComment(commentId, isLike) }); commentItem.render(); // 缓存 CommentItem 实例 @@ -166,7 +166,9 @@ export class CommentList extends Component { replyingTo: this.props.replyingTo, replyContent: this.props.replyContent, replyError: this.props.replyError, - submitting: this.props.submitting + submitting: this.props.submitting, + enableCommentLike: this.props.enableCommentLike, + onLikeComment: (commentId, isLike) => this.handleLikeComment(commentId, isLike) }); }); return; @@ -222,9 +224,9 @@ export class CommentList extends Component { } } - handleLikeComment(commentId) { + handleLikeComment(commentId, isLike) { if (this.props.onLikeComment) { - this.props.onLikeComment(commentId); + this.props.onLikeComment(commentId, isLike); } }