Chats: fix display of media attachments, fix break-words

This commit is contained in:
Alex Gleason 2022-12-06 15:45:33 -06:00
parent e1c80920ed
commit 2ca4db5c3b
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 11 additions and 18 deletions

View file

@ -262,7 +262,7 @@ const Item: React.FC<IItem> = ({
interface IMediaGallery {
sensitive?: boolean,
media: ImmutableList<Attachment>,
height: number,
height?: number,
onOpenMedia: (media: ImmutableList<Attachment>, index: number) => void,
defaultWidth?: number,
cacheWidth?: (width: number) => void,

View file

@ -183,18 +183,15 @@ const ChatMessageList: React.FC<IChatMessageList> = ({ chat }) => {
const { attachment } = chatMessage;
if (!attachment) return null;
return (
<div className='chat-message__media'>
<Bundle fetchComponent={MediaGallery}>
{(Component: any) => (
<Component
media={ImmutableList([attachment])}
height={120}
onOpenMedia={onOpenMedia}
visible
/>
)}
</Bundle>
</div>
);
};
@ -310,7 +307,7 @@ const ChatMessageList: React.FC<IChatMessageList> = ({ chat }) => {
title={getFormattedTimestamp(chatMessage)}
className={
classNames({
'text-ellipsis break-all relative rounded-md py-2 px-3 max-w-full': true,
'text-ellipsis break-words relative rounded-md py-2 px-3 max-w-full space-y-2': true,
'bg-primary-500 text-white': isMyMessage,
'bg-gray-200 dark:bg-gray-800 text-gray-900 dark:text-gray-100': !isMyMessage,
'!bg-transparent !p-0 emoji-lg': isOnlyEmoji,

View file

@ -292,10 +292,6 @@
}
}
.chat-message__media {
height: 120px;
}
.chat-message .media-gallery {
height: 100% !important;
margin: 4px 0 8px;