mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-08 17:44:16 +00:00
parent
765135f824
commit
b894fb69d6
|
@ -56,6 +56,8 @@ export class CommentReport extends Component<CommentReportProps, any> {
|
||||||
moderators={[]}
|
moderators={[]}
|
||||||
admins={[]}
|
admins={[]}
|
||||||
enableDownvotes={true}
|
enableDownvotes={true}
|
||||||
|
viewOnly={true}
|
||||||
|
showCommunity={true}
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
{i18n.t("reporter")}: <PersonListing person={r.creator} />
|
{i18n.t("reporter")}: <PersonListing person={r.creator} />
|
||||||
|
|
|
@ -82,6 +82,7 @@ interface PostListingProps {
|
||||||
admins?: PersonViewSafe[];
|
admins?: PersonViewSafe[];
|
||||||
enableDownvotes: boolean;
|
enableDownvotes: boolean;
|
||||||
enableNsfw: boolean;
|
enableNsfw: boolean;
|
||||||
|
viewOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PostListing extends Component<PostListingProps, PostListingState> {
|
export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
|
@ -513,8 +514,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
return (
|
return (
|
||||||
<div class="d-flex justify-content-start flex-wrap text-muted font-weight-bold mb-1">
|
<div class="d-flex justify-content-start flex-wrap text-muted font-weight-bold mb-1">
|
||||||
{this.commentsButton}
|
{this.commentsButton}
|
||||||
{mobile && this.mobileVotes}
|
{mobile && !this.props.viewOnly && this.mobileVotes}
|
||||||
{UserService.Instance.myUserInfo && this.postActions(mobile)}
|
{UserService.Instance.myUserInfo &&
|
||||||
|
!this.props.viewOnly &&
|
||||||
|
this.postActions(mobile)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1154,7 +1157,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
{/* The larger view*/}
|
{/* The larger view*/}
|
||||||
<div class="d-none d-sm-block">
|
<div class="d-none d-sm-block">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{this.voteBar()}
|
{!this.props.viewOnly && this.voteBar()}
|
||||||
<div class="col-sm-2 pr-0">
|
<div class="col-sm-2 pr-0">
|
||||||
<div class="">{this.thumbnail()}</div>
|
<div class="">{this.thumbnail()}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -48,6 +48,7 @@ export class PostReport extends Component<PostReportProps, any> {
|
||||||
showCommunity={true}
|
showCommunity={true}
|
||||||
enableDownvotes={true}
|
enableDownvotes={true}
|
||||||
enableNsfw={true}
|
enableNsfw={true}
|
||||||
|
viewOnly={true}
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
{i18n.t("reporter")}: <PersonListing person={r.creator} />
|
{i18n.t("reporter")}: <PersonListing person={r.creator} />
|
||||||
|
|
|
@ -1105,7 +1105,7 @@ export function updatePostReportRes(
|
||||||
data: PostReportView,
|
data: PostReportView,
|
||||||
reports: 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) {
|
if (found) {
|
||||||
found.post_report = data.post_report;
|
found.post_report = data.post_report;
|
||||||
}
|
}
|
||||||
|
@ -1115,7 +1115,7 @@ export function updateCommentReportRes(
|
||||||
data: CommentReportView,
|
data: CommentReportView,
|
||||||
reports: 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) {
|
if (found) {
|
||||||
found.comment_report = data.comment_report;
|
found.comment_report = data.comment_report;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue