fix(评论组件): 修复管理员标识逻辑和默认值问题
移除CWDComments中adminBadge的默认值'博主',仅在CommentItem中当adminBadge存在时才显示管理员标识
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -30,10 +30,10 @@ export class CommentItem extends Component {
|
|||||||
this.childCommentItems = []; // 缓存嵌套回复的 CommentItem 实例
|
this.childCommentItems = []; // 缓存嵌套回复的 CommentItem 实例
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { comment, isReply, adminEmail, adminBadge } = this.props;
|
const { comment, isReply, adminEmail, adminBadge } = this.props;
|
||||||
const isReplying = this.props.replyingTo === comment.id;
|
const isReplying = this.props.replyingTo === comment.id;
|
||||||
const isAdmin = adminEmail && comment.email === adminEmail;
|
const isAdmin = adminEmail && adminBadge && comment.email === adminEmail;
|
||||||
|
|
||||||
const root = this.createElement('div', {
|
const root = this.createElement('div', {
|
||||||
className: `cwd-comment-item ${isReply ? 'cwd-comment-reply' : ''}`,
|
className: `cwd-comment-item ${isReply ? 'cwd-comment-reply' : ''}`,
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ export class CWDComments {
|
|||||||
replyError: state.replyError,
|
replyError: state.replyError,
|
||||||
submitting: state.submitting,
|
submitting: state.submitting,
|
||||||
adminEmail: this.config.adminEmail,
|
adminEmail: this.config.adminEmail,
|
||||||
adminBadge: this.config.adminBadge || '博主',
|
adminBadge: this.config.adminBadge,
|
||||||
onRetry: () => this.store.loadComments(),
|
onRetry: () => this.store.loadComments(),
|
||||||
onReply: (commentId) => this.store.startReply(commentId),
|
onReply: (commentId) => this.store.startReply(commentId),
|
||||||
onSubmitReply: (commentId) => this.store.submitReply(commentId),
|
onSubmitReply: (commentId) => this.store.submitReply(commentId),
|
||||||
|
|||||||
Reference in New Issue
Block a user