From d6d614fb6c9e60772a820c5190712b41def18bd9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 7 Nov 2024 12:03:07 -0500 Subject: [PATCH] Fix fullsize post image (#2797) * 0.19.6-beta.8 * 0.19.6-beta.9 * 0.19.6-beta.14 * Using full-size image column, not thumbnail. - Fixes #2796 --- package.json | 2 +- src/shared/components/post/post-listing.tsx | 44 +++++++-------------- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 80df404f..07a9dec3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-ui", "description": "An isomorphic UI for lemmy", - "version": "0.19.6-beta.7", + "version": "0.19.6-beta.14", "author": "Dessalines ", "license": "AGPL-3.0", "scripts": { diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 9a516c88..0ef6fa3f 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -273,18 +273,22 @@ export class PostListing extends Component { } get img() { - const { post } = this.postView; - if (this.isoData.showAdultConsentModal) { return <>; } - if (this.imageSrc) { + // Use the full-size image for expands + const post = this.postView.post; + const url = post.url; + const thumbnail = post.thumbnail_url; + const imageSrc = url && isImage(url) ? url : thumbnail; + + if (imageSrc) { return ( <>
- - + +
@@ -293,7 +297,7 @@ export class PostListing extends Component { className="p-0 border-0 bg-transparent d-inline-block" onClick={linkEvent(this, this.handleImageExpandClick)} > - +
@@ -315,26 +319,12 @@ export class PostListing extends Component { ); } - get imageSrc(): string | undefined { - const post = this.postView.post; - const url = post.url; - const thumbnail = post.thumbnail_url; - - if (thumbnail) { - return thumbnail; - } else if (url && isImage(url)) { - return url; - } else { - return undefined; - } - } - thumbnail() { const post = this.postView.post; const url = post.url; const thumbnail = post.thumbnail_url; - if (!this.props.hideImage && url && isImage(url) && this.imageSrc) { + if (!this.props.hideImage && url && isImage(url) && thumbnail) { return ( ); - } else if ( - !this.props.hideImage && - url && - thumbnail && - this.imageSrc && - !isVideo(url) - ) { + } else if (!this.props.hideImage && url && thumbnail && !isVideo(url)) { return ( { title={url} target={this.linkTarget} > - {this.imgThumb(this.imageSrc)} + {this.imgThumb(thumbnail)}