admins?: PersonViewSafe[];
enableDownvotes: boolean;
enableNsfw: boolean;
+ viewOnly?: boolean;
}
export class PostListing extends Component<PostListingProps, PostListingState> {
return (
<div class="d-flex justify-content-start flex-wrap text-muted font-weight-bold mb-1">
{this.commentsButton}
- {mobile && this.mobileVotes}
- {UserService.Instance.myUserInfo && this.postActions(mobile)}
+ {mobile && !this.props.viewOnly && this.mobileVotes}
+ {UserService.Instance.myUserInfo &&
+ !this.props.viewOnly &&
+ this.postActions(mobile)}
</div>
);
}
{/* The larger view*/}
<div class="d-none d-sm-block">
<div class="row">
- {this.voteBar()}
+ {!this.props.viewOnly && this.voteBar()}
<div class="col-sm-2 pr-0">
<div class="">{this.thumbnail()}</div>
</div>
data: PostReportView,
reports: PostReportView[]
) {
- let found = reports.find(p => p.post.id == data.post.id);
+ let found = reports.find(p => p.post_report.id == data.post_report.id);
if (found) {
found.post_report = data.post_report;
}
data: CommentReportView,
reports: CommentReportView[]
) {
- let found = reports.find(c => c.comment.id == data.comment.id);
+ let found = reports.find(c => c.comment_report.id == data.comment_report.id);
if (found) {
found.comment_report = data.comment_report;
}