From f81039786180b6871300d228209f61cb2a4c68ba Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Fri, 22 Dec 2023 23:00:45 -0500 Subject: [PATCH] some fixes for gifs --- src/components/messaging/EmbedMedia.tsx | 2 +- src/components/messaging/MessageBase.tsx | 1 - src/components/messaging/MessageEmbed.tsx | 11 ++--------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/components/messaging/EmbedMedia.tsx b/src/components/messaging/EmbedMedia.tsx index 977ea1b..d82c67c 100644 --- a/src/components/messaging/EmbedMedia.tsx +++ b/src/components/messaging/EmbedMedia.tsx @@ -98,7 +98,7 @@ function EmbedMedia({ embed, width, height, thumbnail }: Props) { style={{ width, height }} src={url} loop={embed.type === EmbedType.GIFV} - controls={embed.type === EmbedType.GIFV} + controls={embed.type !== EmbedType.GIFV} autoPlay={embed.type === EmbedType.GIFV} muted={embed.type === EmbedType.GIFV ? true : undefined} /> diff --git a/src/components/messaging/MessageBase.tsx b/src/components/messaging/MessageBase.tsx index 7431a40..ea040eb 100644 --- a/src/components/messaging/MessageBase.tsx +++ b/src/components/messaging/MessageBase.tsx @@ -64,7 +64,6 @@ export const MessageInfo = styled.div` export const MessageContent = styled.div` position: relative; min-width: 0; - flex-grow: 1; display: flex; flex-direction: column; justify-content: center; diff --git a/src/components/messaging/MessageEmbed.tsx b/src/components/messaging/MessageEmbed.tsx index 9159fc4..ec2c772 100644 --- a/src/components/messaging/MessageEmbed.tsx +++ b/src/components/messaging/MessageEmbed.tsx @@ -9,7 +9,7 @@ import styles from "./Embed.module.css"; import EmbedMedia from "./EmbedMedia"; import { MESSAGE_AREA_PADDING, MessageAreaWidthContext } from "./MessageList"; -const MAX_EMBED_WIDTH = 400; +const MAX_EMBED_WIDTH = 300; const MAX_EMBED_HEIGHT = 640; const THUMBNAIL_MAX_WIDTH = 80; const CONTAINER_PADDING = 24; @@ -26,7 +26,6 @@ function MessageEmbed({ embed }: Props) { function calculateSize(w: number, h: number): { width: number; height: number } { const limitingWidth = Math.min(w, maxWidth); - const limitingHeight = Math.min(MAX_EMBED_HEIGHT, h); // Calculate smallest possible WxH. @@ -76,13 +75,7 @@ function MessageEmbed({ embed }: Props) { const { width, height } = calculateSize(mw, mh); if (embed.type === EmbedType.GIFV || EMBEDDABLE_PROVIDERS.includes(embed.provider?.name ?? "")) { - return ( - - ); + return ; } return (