From 0af69b34118e425543e5117fa5f9d49eee6a32f6 Mon Sep 17 00:00:00 2001 From: Ashish Dhama <16203333+AshishDhama@users.noreply.github.com> Date: Thu, 6 Apr 2023 00:34:28 +0530 Subject: [PATCH] [MM-51489]: Fix issue with compact message mode (#22711) Automatic Merge --- .../channels/src/components/post/post_component.tsx | 11 ++++++----- webapp/channels/src/components/post/post_options.tsx | 3 ++- webapp/channels/src/sass/components/_post-right.scss | 4 +++- webapp/channels/src/sass/components/_post.scss | 3 +-- webapp/channels/src/sass/responsive/_tablet.scss | 6 ++++++ 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/webapp/channels/src/components/post/post_component.tsx b/webapp/channels/src/components/post/post_component.tsx index 907792dcd1..be4927ebed 100644 --- a/webapp/channels/src/components/post/post_component.tsx +++ b/webapp/channels/src/components/post/post_component.tsx @@ -254,16 +254,16 @@ const PostComponent = (props: Props): JSX.Element => { 'current--user': props.currentUserId === post.user_id && !isSystemMessage, 'post--system': isSystemMessage || isMeMessage, 'post--root': props.hasReplies && !(post.root_id && post.root_id.length > 0), - 'post--comment': post.root_id && post.root_id.length > 0 && !props.isCollapsedThreadsEnabled, + 'post--comment': (post.root_id && post.root_id.length > 0 && !props.isCollapsedThreadsEnabled) || (props.location === Locations.RHS_COMMENT), 'post--compact': props.compactDisplay, 'post--hovered': hovered, - 'same--user': props.isConsecutivePost && !props.compactDisplay, + 'same--user': props.isConsecutivePost && (!props.compactDisplay || props.location === Locations.RHS_COMMENT), 'cursor--pointer': alt && !props.channelIsArchived, 'post--hide-controls': post.failed || post.state === Posts.POST_DELETED, 'post--comment same--root': fromAutoResponder, 'post--pinned-or-flagged': (post.is_pinned || props.isFlagged) && props.location === Locations.CENTER, 'mention-comment': props.isCommentMention, - 'post--thread': props.location === Locations.RHS_COMMENT || Locations.RHS_ROOT, + 'post--thread': props.location === Locations.RHS_COMMENT || props.location === Locations.RHS_ROOT, }); }; @@ -378,7 +378,8 @@ const PostComponent = (props: Props): JSX.Element => { let profilePic; const hideProfilePicture = hasSameRoot(props) && (!post.root_id && !props.hasReplies) && !PostUtils.isFromBot(post); - if (!hideProfilePicture) { + const hideProfileCase = !(props.location === Locations.RHS_COMMENT && props.compactDisplay && props.isConsecutivePost); + if (!hideProfilePicture && hideProfileCase) { profilePic = ( { isSystemMessage={isSystemMessage} />
- { + {((!hideProfilePicture && props.location === Locations.CENTER) || hover || props.location !== Locations.CENTER) && {
{!collapsedThreadsEnabled && !showRecentlyUsedReactions && dotMenu} {showRecentReactions} diff --git a/webapp/channels/src/sass/components/_post-right.scss b/webapp/channels/src/sass/components/_post-right.scss index ff9c7be945..c5784a917d 100644 --- a/webapp/channels/src/sass/components/_post-right.scss +++ b/webapp/channels/src/sass/components/_post-right.scss @@ -79,6 +79,8 @@ } &.post--compact { + padding-left: 1em; + .post__body { padding-left: 0; } @@ -102,7 +104,7 @@ &.same--user { .post__header { .col__name { - display: inline-block; + display: flex; } } } diff --git a/webapp/channels/src/sass/components/_post.scss b/webapp/channels/src/sass/components/_post.scss index f1aeca6b83..0a1dbb46d6 100644 --- a/webapp/channels/src/sass/components/_post.scss +++ b/webapp/channels/src/sass/components/_post.scss @@ -2395,8 +2395,7 @@ .post.current--user { &.other--root, - &.post--root, - &.post--comment { + &.post--root, { .post__header-set-custom-status { display: revert; padding: 0 6px; diff --git a/webapp/channels/src/sass/responsive/_tablet.scss b/webapp/channels/src/sass/responsive/_tablet.scss index 31d24fbc3f..c9159f6966 100644 --- a/webapp/channels/src/sass/responsive/_tablet.scss +++ b/webapp/channels/src/sass/responsive/_tablet.scss @@ -292,6 +292,8 @@ .post__permalink { position: absolute; top: 1px; + left: -76px; + width: 60px; text-align: right; } @@ -355,6 +357,10 @@ .post__header { .post-menu { top: -34px; + + &.post-menu--position { + top: -12px; + } } } }