From 1b020b2a9ba00e1b2b591820c51664049ca731d8 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 23 Feb 2023 16:05:24 -0600 Subject: [PATCH] Improve rounded courners in MediaGallery and Chats --- app/soapbox/components/media-gallery.tsx | 30 +++++++++++++++---- .../chats/components/chat-message.tsx | 7 ++++- app/styles/components/media-gallery.scss | 4 +-- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/app/soapbox/components/media-gallery.tsx b/app/soapbox/components/media-gallery.tsx index 001ac0729..0c26b26f6 100644 --- a/app/soapbox/components/media-gallery.tsx +++ b/app/soapbox/components/media-gallery.tsx @@ -152,7 +152,14 @@ const Item: React.FC = ({ ); return ( -
+
1, + })} + key={attachment.id} + style={{ position, float, left, top, right, bottom, height, width: `${width}%` }} + > {attachmentIcon} @@ -245,7 +252,14 @@ const Item: React.FC = ({ } return ( -
+
1, + })} + key={attachment.id} + style={{ position, float, left, top, right, bottom, height, width: `${width}%` }} + > {last && total > ATTACHMENT_LIMIT && (
+{total - ATTACHMENT_LIMIT + 1} @@ -260,7 +274,7 @@ const Item: React.FC = ({ ); }; -interface IMediaGallery { +export interface IMediaGallery { sensitive?: boolean media: ImmutableList height?: number @@ -270,13 +284,15 @@ interface IMediaGallery { visible?: boolean onToggleVisibility?: () => void displayMedia?: string - compact: boolean + compact?: boolean + className?: string } const MediaGallery: React.FC = (props) => { const { media, defaultWidth = 0, + className, onOpenMedia, cacheWidth, compact, @@ -546,7 +562,11 @@ const MediaGallery: React.FC = (props) => { }, [node.current]); return ( -
+
{children}
); diff --git a/app/soapbox/features/chats/components/chat-message.tsx b/app/soapbox/features/chats/components/chat-message.tsx index 597c78ef1..eccdaa6d7 100644 --- a/app/soapbox/features/chats/components/chat-message.tsx +++ b/app/soapbox/features/chats/components/chat-message.tsx @@ -23,6 +23,7 @@ import ChatMessageReaction from './chat-message-reaction'; import ChatMessageReactionWrapper from './chat-message-reaction-wrapper/chat-message-reaction-wrapper'; import type { Menu as IMenu } from 'soapbox/components/dropdown-menu'; +import type { IMediaGallery } from 'soapbox/components/media-gallery'; import type { ChatMessage as ChatMessageEntity } from 'soapbox/types/entities'; const messages = defineMessages({ @@ -112,8 +113,12 @@ const ChatMessage = (props: IChatMessage) => { return ( - {(Component: any) => ( + {(Component: React.FC) => (