diff --git a/webapp/channels/src/components/post/post_component.tsx b/webapp/channels/src/components/post/post_component.tsx index 7445cfb591..ace78e7bf4 100644 --- a/webapp/channels/src/components/post/post_component.tsx +++ b/webapp/channels/src/components/post/post_component.tsx @@ -509,10 +509,7 @@ const PostComponent = (props: Props): JSX.Element => { } return ( -
+ <> {(isSearchResultItem || (props.location !== Locations.CENTER && (props.isPinnedPosts || props.isFlaggedPosts))) && } {
- + ); }; diff --git a/webapp/channels/src/components/search_results/post_search_results_item.tsx b/webapp/channels/src/components/search_results/post_search_results_item.tsx new file mode 100644 index 0000000000..83a46780c7 --- /dev/null +++ b/webapp/channels/src/components/search_results/post_search_results_item.tsx @@ -0,0 +1,38 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import React from 'react'; + +import {Post} from '@mattermost/types/posts'; + +import PostComponent from 'components/post'; + +import {Locations} from 'utils/constants'; + +type Props = { + a11yIndex: number; + isFlaggedPosts: boolean; + isMentionSearch: boolean; + isPinnedPosts: boolean; + matches: string[]; + post: Post; + searchTerm: string; +} + +export default function PostSearchResultsItem(props: Props) { + return ( +
+ +
+ ); +} diff --git a/webapp/channels/src/components/search_results/search_results.tsx b/webapp/channels/src/components/search_results/search_results.tsx index 3e346c0f7d..599f9e51aa 100644 --- a/webapp/channels/src/components/search_results/search_results.tsx +++ b/webapp/channels/src/components/search_results/search_results.tsx @@ -21,17 +21,16 @@ import FileSearchResultItem from 'components/file_search_results'; import {NoResultsVariant} from 'components/no_results_indicator/types'; import * as Utils from 'utils/utils'; -import {searchHintOptions, DataSearchTypes, Locations} from 'utils/constants'; +import {searchHintOptions, DataSearchTypes} from 'utils/constants'; import {isFileAttachmentsEnabled} from 'utils/file_utils'; import {t} from 'utils/i18n'; import {Post} from '@mattermost/types/posts'; import {FileSearchResultItem as FileSearchResultItemType} from '@mattermost/types/files'; -import PostComponent from 'components/post'; - import MessageOrFileSelector from './messages_or_files_selector'; import FilesFilterMenu from './files_filter_menu'; +import PostSearchResultsItem from './post_search_results_item'; import SearchLimitsBanner from './search_limits_banner'; import type {Props} from './types'; @@ -286,14 +285,15 @@ const SearchResults: React.FC = (props: Props): JSX.Element => { contentItems = sortedResults.map((item: Post|FileSearchResultItemType, index: number) => { if (searchType === DataSearchTypes.MESSAGES_SEARCH_TYPE && !props.isChannelFiles) { return ( - ); } diff --git a/webapp/channels/src/components/threading/thread_viewer/thread_viewer.scss b/webapp/channels/src/components/threading/thread_viewer/thread_viewer.scss index 128821b22d..1604e7f1f4 100644 --- a/webapp/channels/src/components/threading/thread_viewer/thread_viewer.scss +++ b/webapp/channels/src/components/threading/thread_viewer/thread_viewer.scss @@ -8,34 +8,11 @@ text-align: left !important; } - .new-separator { - .NotificationSeparator { - padding-top: 0; - } - - & + .post { - padding-top: 1em !important; - } - } - .post-list__dynamic--RHS { scrollbar-color: var(--center-channel-color-32) #fff0; scrollbar-width: thin; } - .post-right-comments-container > .new-separator, - .post + .new-separator { - .NotificationSeparator { - padding-top: 1em; - } - } - - .Separator + .new-separator { - .NotificationSeparator { - padding-top: 2em; - } - } - > div { flex: 1 1 auto; } diff --git a/webapp/channels/src/sass/components/_post.scss b/webapp/channels/src/sass/components/_post.scss index 293bef16f0..f3be0862d9 100644 --- a/webapp/channels/src/sass/components/_post.scss +++ b/webapp/channels/src/sass/components/_post.scss @@ -2180,8 +2180,12 @@ } .post-row__padding { - &.top > div:not(.post) { - padding-top: 0; + &.bottom .Separator { + padding-bottom: 1em; + } + + &.top .Separator { + padding-top: 1em; } &.top .post {