From: Dessalines Date: Fri, 18 Nov 2022 02:11:30 +0000 (-0500) Subject: Hide post report images. Fixes #824 (#861) X-Git-Url: http://these/git/%22%7Burl%7D/%7B%60%24%7BghostArchiveUrl%7D/static/readmes/README.ru.md?a=commitdiff_plain;h=f90fa6dd3bd2b118de3c4440d5cd7163facf5b9a;p=lemmy-ui.git Hide post report images. Fixes #824 (#861) --- diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 7a8bdb6..be06cb2 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -93,6 +93,7 @@ interface PostListingProps { allLanguages: Language[]; showCommunity?: boolean; showBody?: boolean; + hideImage?: boolean; enableDownvotes?: boolean; enableNsfw?: boolean; viewOnly?: boolean; @@ -156,7 +157,7 @@ export class PostListing extends Component { {!this.state.showEdit ? ( <> {this.listing()} - {this.state.imageExpanded && this.img} + {this.state.imageExpanded && !this.props.hideImage && this.img} {post.url.isSome() && this.showBody && post.embed_title.isSome() && } @@ -255,7 +256,7 @@ export class PostListing extends Component { let url = post.url; let thumbnail = post.thumbnail_url; - if (url.isSome() && isImage(url.unwrap())) { + if (!this.props.hideImage && url.isSome() && isImage(url.unwrap())) { return ( { ); - } else if (url.isSome() && thumbnail.isSome()) { + } else if (!this.props.hideImage && url.isSome() && thumbnail.isSome()) { return ( { ); } else if (url.isSome()) { - if (isVideo(url.unwrap())) { + if (!this.props.hideImage && isVideo(url.unwrap())) { return (