From 03a77f7c4feab8542f73e2b5f1dc8fd9d49033d7 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sun, 14 Apr 2024 15:39:35 -0400 Subject: [PATCH] some embed tweaks --- src/components/messaging/Embed.module.css | 2 ++ src/components/messaging/EmbedMedia.tsx | 3 +-- src/components/messaging/MessageEmbed.tsx | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/messaging/Embed.module.css b/src/components/messaging/Embed.module.css index 41ea2b8..713b693 100644 --- a/src/components/messaging/Embed.module.css +++ b/src/components/messaging/Embed.module.css @@ -18,6 +18,7 @@ iframe { .embedImage { cursor: pointer; border-radius: 8px; + max-width: 100%; } .website { @@ -100,6 +101,7 @@ iframe { .embedDescription { font-size: 14px; + line-height: 16px; overflow: hidden; display: -webkit-box; white-space: pre-wrap; diff --git a/src/components/messaging/EmbedMedia.tsx b/src/components/messaging/EmbedMedia.tsx index 03863de..b312871 100644 --- a/src/components/messaging/EmbedMedia.tsx +++ b/src/components/messaging/EmbedMedia.tsx @@ -128,7 +128,6 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) { className={styles.embedImage} src={url} loading="lazy" - style={{ width: "100%", height: "100%" }} onClick={() => { modalController.push({ type: "image_viewer", @@ -145,7 +144,7 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) { className={thumbnail ? styles.embedThumbnail : styles.embedImage} src={url} loading="lazy" - style={{ width, height }} + style={{ width: thumbnail ? width : undefined, height }} onClick={() => { modalController.push({ type: "image_viewer", diff --git a/src/components/messaging/MessageEmbed.tsx b/src/components/messaging/MessageEmbed.tsx index c3d3d47..7f6124f 100644 --- a/src/components/messaging/MessageEmbed.tsx +++ b/src/components/messaging/MessageEmbed.tsx @@ -11,7 +11,7 @@ import styles from "./Embed.module.css"; import EmbedMedia from "./EmbedMedia"; import { MESSAGE_AREA_PADDING, MessageAreaWidthContext } from "./MessageList"; -const MAX_EMBED_WIDTH = 300; +const MAX_EMBED_WIDTH = 400; const MAX_EMBED_HEIGHT = 640; const THUMBNAIL_MAX_WIDTH = 80; const CONTAINER_PADDING = 24; @@ -108,7 +108,7 @@ function MessageEmbed({ embed }: Props) { className={styles.embedAuthorIcon} src={embed.author.icon_url} draggable={false} - onError={(e) => (e.currentTarget.style.display = "none")} + // onError={(e) => (e.currentTarget.style.display = "none")} /> )} {embed.author.url ? ( @@ -190,7 +190,7 @@ function MessageEmbed({ embed }: Props) { className={styles.embedFooterIcon} src={embed.footer.icon_url} draggable={false} - onError={(e) => (e.currentTarget.style.display = "none")} + // onError={(e) => (e.currentTarget.style.display = "none")} /> )}