mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-08 17:44:16 +00:00
Hide post report images. Fixes #824
This commit is contained in:
parent
78a6a19d8d
commit
96d738b48b
|
@ -93,6 +93,7 @@ interface PostListingProps {
|
||||||
allLanguages: Language[];
|
allLanguages: Language[];
|
||||||
showCommunity?: boolean;
|
showCommunity?: boolean;
|
||||||
showBody?: boolean;
|
showBody?: boolean;
|
||||||
|
hideImage?: boolean;
|
||||||
enableDownvotes?: boolean;
|
enableDownvotes?: boolean;
|
||||||
enableNsfw?: boolean;
|
enableNsfw?: boolean;
|
||||||
viewOnly?: boolean;
|
viewOnly?: boolean;
|
||||||
|
@ -156,7 +157,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
{!this.state.showEdit ? (
|
{!this.state.showEdit ? (
|
||||||
<>
|
<>
|
||||||
{this.listing()}
|
{this.listing()}
|
||||||
{this.state.imageExpanded && this.img}
|
{this.state.imageExpanded && !this.props.hideImage && this.img}
|
||||||
{post.url.isSome() &&
|
{post.url.isSome() &&
|
||||||
this.showBody &&
|
this.showBody &&
|
||||||
post.embed_title.isSome() && <MetadataCard post={post} />}
|
post.embed_title.isSome() && <MetadataCard post={post} />}
|
||||||
|
@ -255,7 +256,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
let url = post.url;
|
let url = post.url;
|
||||||
let thumbnail = post.thumbnail_url;
|
let thumbnail = post.thumbnail_url;
|
||||||
|
|
||||||
if (url.isSome() && isImage(url.unwrap())) {
|
if (!this.props.hideImage && url.isSome() && isImage(url.unwrap())) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
href={this.imageSrc.unwrap()}
|
href={this.imageSrc.unwrap()}
|
||||||
|
@ -268,7 +269,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
<Icon icon="image" classes="mini-overlay" />
|
<Icon icon="image" classes="mini-overlay" />
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
} else if (url.isSome() && thumbnail.isSome()) {
|
} else if (!this.props.hideImage && url.isSome() && thumbnail.isSome()) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className="text-body d-inline-block position-relative mb-2"
|
className="text-body d-inline-block position-relative mb-2"
|
||||||
|
@ -281,7 +282,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
} else if (url.isSome()) {
|
} else if (url.isSome()) {
|
||||||
if (isVideo(url.unwrap())) {
|
if (!this.props.hideImage && isVideo(url.unwrap())) {
|
||||||
return (
|
return (
|
||||||
<div className="embed-responsive embed-responsive-16by9">
|
<div className="embed-responsive embed-responsive-16by9">
|
||||||
<video
|
<video
|
||||||
|
|
|
@ -60,6 +60,7 @@ export class PostReport extends Component<PostReportProps, any> {
|
||||||
enableNsfw={true}
|
enableNsfw={true}
|
||||||
viewOnly={true}
|
viewOnly={true}
|
||||||
allLanguages={[]}
|
allLanguages={[]}
|
||||||
|
hideImage
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
{i18n.t("reporter")}: <PersonListing person={r.creator} />
|
{i18n.t("reporter")}: <PersonListing person={r.creator} />
|
||||||
|
|
Loading…
Reference in a new issue