Skip to content

Commit

Permalink
Fix embed image width
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Nov 17, 2024
1 parent a37bd62 commit 0d0ea8d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions 0006-Fix-embed-width.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 9ae9b83ea4f90c6f2f6e7c789c30db14e458176e Mon Sep 17 00:00:00 2001
From: I-Al-Istannen <[email protected]>
Date: Sun, 17 Nov 2024 22:48:54 +0100
Subject: [PATCH] Fix embed width

---
.../content/message_attachments/attachment_image/index.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx b/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx
index f46fd44b1..bb1db2f7f 100644
--- a/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx
+++ b/app/components/post_list/post/body/content/message_attachments/attachment_image/index.tsx
@@ -57,7 +57,8 @@ const AttachmentImage = ({imageUrl, imageMetadata, layoutWidth, location, postId
const [error, setError] = useState(false);
const fileId = useRef(generateId('uid')).current;
const isTablet = useIsTablet();
- const {height, width} = calculateDimensions(imageMetadata.height, imageMetadata.width, layoutWidth || getViewPortWidth(false, isTablet));
+ let {height, width} = calculateDimensions(imageMetadata.height, imageMetadata.width, layoutWidth || getViewPortWidth(false, isTablet));
+ width -= 32; // margin right is actually larger in embeds
const style = getStyleSheet(theme);

const onError = useCallback(() => {
--
2.47.0

0 comments on commit 0d0ea8d

Please sign in to comment.