markable?: boolean;
moderators: Array<CommunityUser>;
admins: Array<UserView>;
+ postCreatorId?: number;
}
export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
{this.isAdmin &&
<li className="list-inline-item badge badge-light"><T i18nKey="admin">#</T></li>
}
+ {this.isPostCreator &&
+ <li className="list-inline-item badge badge-light"><T i18nKey="creator">#</T></li>
+ }
{(node.comment.banned_from_community || node.comment.banned) &&
<li className="list-inline-item badge badge-danger"><T i18nKey="banned">#</T></li>
}
locked={this.props.locked}
moderators={this.props.moderators}
admins={this.props.admins}
+ postCreatorId={this.props.postCreatorId}
/>
}
{/* A collapsed clearfix */}
return this.props.admins && isMod(this.props.admins.map(a => a.id), this.props.node.comment.creator_id);
}
+ get isPostCreator(): boolean {
+ return this.props.node.comment.creator_id == this.props.postCreatorId;
+ }
+
get canMod(): boolean {
if (this.props.admins && this.props.moderators) {
nodes: Array<CommentNodeI>;
moderators?: Array<CommunityUser>;
admins?: Array<UserView>;
+ postCreatorId?: number;
noIndent?: boolean;
viewOnly?: boolean;
locked?: boolean;
locked={this.props.locked}
moderators={this.props.moderators}
admins={this.props.admins}
+ postCreatorId={this.props.postCreatorId}
markable={this.props.markable}
/>
)}
locked={this.state.post.locked}
moderators={this.state.moderators}
admins={this.state.admins}
+ postCreatorId={this.state.post.creator_id}
/>
)}
</div>
locked={this.state.post.locked}
moderators={this.state.moderators}
admins={this.state.admins}
+ postCreatorId={this.state.post.creator_id}
/>
</div>
);