feat(评论组件): 在回复编辑器中添加用户信息输入支持
当用户首次评论或缺少昵称/邮箱时,在回复编辑器中显示用户信息输入框。修改了CWDComments、CommentList、CommentItem和ReplyEditor组件,通过currentUser和onUpdateUserInfo属性传递用户数据和更新回调,确保用户信息在回复过程中可收集和更新。
This commit is contained in:
@@ -204,6 +204,8 @@ export class CommentItem extends Component {
|
||||
content: this.props.replyContent,
|
||||
error: this.props.replyError,
|
||||
submitting: this.props.submitting,
|
||||
currentUser: this.props.currentUser,
|
||||
onUpdateUserInfo: this.props.onUpdateUserInfo,
|
||||
onUpdate: (content) => this.handleUpdateReplyContent(content),
|
||||
onSubmit: () => this.handleSubmitReply(),
|
||||
onCancel: () => this.handleCancelReply(),
|
||||
@@ -229,6 +231,8 @@ export class CommentItem extends Component {
|
||||
replyContent: this.props.replyContent,
|
||||
replyError: this.props.replyError,
|
||||
submitting: this.props.submitting,
|
||||
currentUser: this.props.currentUser,
|
||||
onUpdateUserInfo: this.props.onUpdateUserInfo,
|
||||
adminEmail: this.props.adminEmail,
|
||||
adminBadge: this.props.adminBadge,
|
||||
enableCommentLike: this.props.enableCommentLike,
|
||||
@@ -278,6 +282,8 @@ export class CommentItem extends Component {
|
||||
content: this.props.replyContent,
|
||||
error: this.props.replyError,
|
||||
submitting: this.props.submitting,
|
||||
currentUser: this.props.currentUser,
|
||||
onUpdateUserInfo: this.props.onUpdateUserInfo,
|
||||
onUpdate: (content) => this.handleUpdateReplyContent(content),
|
||||
onSubmit: () => this.handleSubmitReply(),
|
||||
onCancel: () => this.handleCancelReply(),
|
||||
@@ -295,7 +301,8 @@ export class CommentItem extends Component {
|
||||
this.replyEditor.setProps({
|
||||
content: this.props.replyContent,
|
||||
error: this.props.replyError,
|
||||
submitting: this.props.submitting
|
||||
submitting: this.props.submitting,
|
||||
currentUser: this.props.currentUser
|
||||
});
|
||||
}
|
||||
|
||||
@@ -307,6 +314,7 @@ export class CommentItem extends Component {
|
||||
replyContent: this.props.replyContent,
|
||||
replyError: this.props.replyError,
|
||||
submitting: this.props.submitting,
|
||||
currentUser: this.props.currentUser,
|
||||
enableCommentLike: this.props.enableCommentLike,
|
||||
onLikeComment: this.props.onLikeComment
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user