]> Untitled Git - lemmy-ui.git/commitdiff
feat(post-listing): Add link to post for mobile preview
authorMarcin Mróz <marcin.mroz@displate.com>
Thu, 15 Jun 2023 17:21:42 +0000 (19:21 +0200)
committerMarcin Mróz <marcin.mroz@displate.com>
Thu, 15 Jun 2023 17:21:42 +0000 (19:21 +0200)
src/shared/components/post/post-listing.tsx

index d5fc785c3747f38c5486cbe3f919694fa8a9deb9..60e188a33b77c942ba5e9f33cdceb29a8e07e6bb 100644 (file)
@@ -1382,9 +1382,12 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
   }
 
   showMobilePreview() {
-    const body = this.postView.post.body;
+    const { body, id } = this.postView.post;
+
     return !this.showBody && body ? (
-      <div className="md-div mb-1 preview-lines">{body}</div>
+      <Link className="text-body" to={`/post/${id}`}>
+        <div className="md-div mb-1 preview-lines">{body}</div>
+      </Link>
     ) : (
       <></>
     );