From 78da584c029f421680a854b08fe5bb097235e052 Mon Sep 17 00:00:00 2001 From: William Grant Date: Thu, 8 Feb 2024 15:46:37 +1100 Subject: [PATCH] fix: right panel settings media should not have a scroll bar combined containers for messageInfoOverlay --- .../media-gallery/MediaGallery.tsx | 4 +- .../overlay/OverlayRightPanelSettings.tsx | 132 +++++++------- .../message-info/OverlayMessageInfo.tsx | 172 +++++++++--------- 3 files changed, 154 insertions(+), 154 deletions(-) diff --git a/ts/components/conversation/media-gallery/MediaGallery.tsx b/ts/components/conversation/media-gallery/MediaGallery.tsx index 0900e4622..9cd558233 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.tsx @@ -1,9 +1,9 @@ -import React, { useCallback, useState } from 'react'; import classNames from 'classnames'; +import React, { useCallback, useState } from 'react'; +import { MediaItemType } from '../../lightbox/LightboxGallery'; import { AttachmentSection } from './AttachmentSection'; import { EmptyState } from './EmptyState'; -import { MediaItemType } from '../../lightbox/LightboxGallery'; type Props = { documents: Array; diff --git a/ts/components/conversation/right-panel/overlay/OverlayRightPanelSettings.tsx b/ts/components/conversation/right-panel/overlay/OverlayRightPanelSettings.tsx index c08aa5498..cab16bfee 100644 --- a/ts/components/conversation/right-panel/overlay/OverlayRightPanelSettings.tsx +++ b/ts/components/conversation/right-panel/overlay/OverlayRightPanelSettings.tsx @@ -42,11 +42,11 @@ import { AttachmentTypeWithPath } from '../../../../types/Attachment'; import { getAbsoluteAttachmentPath } from '../../../../types/MessageAttachment'; import { Avatar, AvatarSize } from '../../../avatar/Avatar'; import { Flex } from '../../../basic/Flex'; -import { SpacerMD } from '../../../basic/Text'; +import { SpacerLG, SpacerMD, SpacerXL } from '../../../basic/Text'; import { PanelButtonGroup, PanelIconButton } from '../../../buttons'; import { MediaItemType } from '../../../lightbox/LightboxGallery'; import { MediaGallery } from '../../media-gallery/MediaGallery'; -import { Header } from './components'; +import { Header, StyledScrollContainer } from './components'; async function getMediaGalleryProps( conversationId: string @@ -278,77 +278,81 @@ export const OverlayRightPanelSettings = () => { }; return ( - <> - - - {showUpdateGroupNameButton && ( - { - void showUpdateGroupNameByConvoId(selectedConvoKey); - }} - dataTestId="edit-group-name" - /> - )} - - {showAddRemoveModeratorsButton && ( - <> + + + + + {showUpdateGroupNameButton && ( { - showAddModeratorsByConvoId(selectedConvoKey); + void showUpdateGroupNameByConvoId(selectedConvoKey); }} - dataTestId="add-moderators" + dataTestId="edit-group-name" /> - + )} + + {showAddRemoveModeratorsButton && ( + <> + { + showAddModeratorsByConvoId(selectedConvoKey); + }} + dataTestId="add-moderators" + /> + + { + showRemoveModeratorsByConvoId(selectedConvoKey); + }} + dataTestId="remove-moderators" + /> + + )} + + {showUpdateGroupMembersButton && ( { - showRemoveModeratorsByConvoId(selectedConvoKey); + void showUpdateGroupMembersByConvoId(selectedConvoKey); }} - dataTestId="remove-moderators" + dataTestId="group-members" /> - - )} + )} - {showUpdateGroupMembersButton && ( - { - void showUpdateGroupMembersByConvoId(selectedConvoKey); - }} - dataTestId="group-members" - /> - )} - - {hasDisappearingMessages && ( - { - dispatch(setRightOverlayMode({ type: 'disappearing_messages', params: null })); - }} - /> - )} + {hasDisappearingMessages && ( + { + dispatch(setRightOverlayMode({ type: 'disappearing_messages', params: null })); + }} + /> + )} - - {isGroup && ( - void deleteConvoAction()} - color={'var(--danger-color)'} - iconType={'delete'} - /> - )} - - + + {isGroup && ( + void deleteConvoAction()} + color={'var(--danger-color)'} + iconType={'delete'} + /> + )} + + + + + ); }; diff --git a/ts/components/conversation/right-panel/overlay/message-info/OverlayMessageInfo.tsx b/ts/components/conversation/right-panel/overlay/message-info/OverlayMessageInfo.tsx index d5358a073..496babbeb 100644 --- a/ts/components/conversation/right-panel/overlay/message-info/OverlayMessageInfo.tsx +++ b/ts/components/conversation/right-panel/overlay/message-info/OverlayMessageInfo.tsx @@ -77,15 +77,13 @@ const MessageBody = ({ ); }; -const StyledMessageDetailContainer = styled.div` +const StyledMessageInfoContainer = styled.div` height: calc(100% - 48px); width: 100%; - overflow-y: auto; + max-width: 650px; + overflow: hidden auto; z-index: 2; -`; -const StyledMessageDetail = styled.div` - max-width: 650px; margin-inline-start: auto; margin-inline-end: auto; padding: var(--margins-sm) var(--margins-2xl) var(--margins-lg); @@ -254,96 +252,94 @@ export const OverlayMessageInfo = () => {
{window.i18n('messageInfo')}
- - - + + {hasAttachments && ( + <> + {supportsAttachmentCarousel && ( + <> + { + handleChangeAttachment(1); + }} + previousAction={() => { + handleChangeAttachment(-1); + }} + /> + + + )} + + + + )} + + + + { + // eslint-disable-next-line more/no-then + void replyToMessage(messageId).then(foundIt => { + if (foundIt) { + dispatch(closeRightPanel()); + dispatch(resetRightOverlayMode()); + } + }); + }} + dataTestId="reply-to-msg-from-details" /> + {hasErrors && direction === 'outgoing' && ( + { + void resendMessage(messageId); + dispatch(closeRightPanel()); + dispatch(resetRightOverlayMode()); + }} + dataTestId="resend-msg-from-details" + /> + )} {hasAttachments && ( - <> - {supportsAttachmentCarousel && ( - <> - { - handleChangeAttachment(1); - }} - previousAction={() => { - handleChangeAttachment(-1); - }} - /> - - - )} - - - + { + if (hasAttachments) { + void saveAttachmentToDisk({ + conversationId: convoId, + messageSender: sender, + messageTimestamp: serverTimestamp || timestamp || Date.now(), + attachment: attachments[visibleAttachmentIndex], + index: visibleAttachmentIndex, + }); + } + }} + /> )} - - - + {isDeletable && ( { - // eslint-disable-next-line more/no-then - void replyToMessage(messageId).then(foundIt => { - if (foundIt) { - dispatch(closeRightPanel()); - dispatch(resetRightOverlayMode()); - } - }); + void deleteMessagesById([messageId], convoId); }} - dataTestId="reply-to-msg-from-details" /> - {hasErrors && direction === 'outgoing' && ( - { - void resendMessage(messageId); - dispatch(closeRightPanel()); - dispatch(resetRightOverlayMode()); - }} - dataTestId="resend-msg-from-details" - /> - )} - {hasAttachments && ( - { - if (hasAttachments) { - void saveAttachmentToDisk({ - conversationId: convoId, - messageSender: sender, - messageTimestamp: serverTimestamp || timestamp || Date.now(), - attachment: attachments[visibleAttachmentIndex], - index: visibleAttachmentIndex, - }); - } - }} - /> - )} - {isDeletable && ( - { - void deleteMessagesById([messageId], convoId); - }} - /> - )} - - - - + )} + + + );