From 521938b5eb464b2c9fdbcc5f4d1f3390b47277e4 Mon Sep 17 00:00:00 2001 From: William Grant Date: Thu, 23 May 2024 21:20:04 +1000 Subject: [PATCH] fix: hide message preview for contact during search --- stylesheets/_modules.scss | 1 - .../ConversationListItem.tsx | 16 +++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index 3a7e348fa..983f51c20 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -622,7 +622,6 @@ display: flex; flex-direction: row; align-items: center; - margin-bottom: var(--margins-xs); } .module-conversation-list-item__header__name { diff --git a/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx b/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx index a1d95ba47..27ab49ddf 100644 --- a/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx +++ b/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx @@ -5,6 +5,7 @@ import { contextMenu } from 'react-contexify'; import { createPortal } from 'react-dom'; import { useDispatch, useSelector } from 'react-redux'; +import { CSSProperties } from 'styled-components'; import { Avatar, AvatarSize } from '../../avatar/Avatar'; import { openConversationWithMessages } from '../../../state/ducks/conversations'; @@ -24,16 +25,11 @@ import { } from '../../../hooks/useParamSelector'; import { isSearching } from '../../../state/selectors/search'; import { useSelectedConversationKey } from '../../../state/selectors/selectedConversation'; +import { SpacerXS } from '../../basic/Text'; import { MemoConversationListItemContextMenu } from '../../menu/ConversationListItemContextMenu'; import { ConversationListItemHeaderItem } from './HeaderItem'; import { MessageItem } from './MessageItem'; -type PropsHousekeeping = { - style?: object; -}; - -type Props = { conversationId: string } & PropsHousekeeping; - const Portal = ({ children }: { children: ReactNode }) => { return createPortal(children, document.querySelector('.inbox.index') as Element); }; @@ -65,6 +61,7 @@ const AvatarItem = () => { ); }; +type Props = { conversationId: string; style?: CSSProperties }; const ConversationListItemInner = (props: Props) => { const { conversationId, style } = props; @@ -125,7 +122,12 @@ const ConversationListItemInner = (props: Props) => {
- + {!isSearch ? ( + <> + + + + ) : null}