From e3b130eaea4bf194e203d000500cf5dfbdb54c66 Mon Sep 17 00:00:00 2001 From: Amir Ghezelbash Date: Tue, 26 Sep 2023 12:31:56 +0300 Subject: [PATCH] fix: Add pending icon to outgoing connection request (WPB-4849) (#15894) * Fix: Add pending icon to outgoing connection request (WPB-4849) * remove extra deps * move isRequest logic to conversation --- .../components/list/ConversationListCell.tsx | 79 +----------- .../list/ConversationListCellStatusIcon.tsx | 119 ++++++++++++++++++ src/script/entity/Conversation.ts | 4 +- 3 files changed, 125 insertions(+), 77 deletions(-) create mode 100644 src/script/components/list/ConversationListCellStatusIcon.tsx diff --git a/src/script/components/list/ConversationListCell.tsx b/src/script/components/list/ConversationListCell.tsx index 8049b22166c..0ff7519368c 100644 --- a/src/script/components/list/ConversationListCell.tsx +++ b/src/script/components/list/ConversationListCell.tsx @@ -33,14 +33,14 @@ import {Availability} from '@wireapp/protocol-messaging'; import {AvailabilityState} from 'Components/AvailabilityState'; import {Avatar, AVATAR_SIZE, GroupAvatar} from 'Components/Avatar'; -import {Icon} from 'Components/Icon'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {isKey, isOneOfKeys, KEY} from 'Util/KeyboardUtil'; import {t} from 'Util/LocalizerUtil'; import {noop, setContextMenuPosition} from 'Util/util'; +import {ConversationListCellStatusIcon} from './ConversationListCellStatusIcon'; + import {generateCellState} from '../../conversation/ConversationCellState'; -import {ConversationStatusIcon} from '../../conversation/ConversationStatusIcon'; import type {Conversation} from '../../entity/Conversation'; import {MediaType} from '../../media/MediaType'; @@ -252,80 +252,7 @@ const ConversationListCell = ({ onKeyDown={handleContextKeyDown} /> - {!showJoinButton && ( - <> - {cellState.icon === ConversationStatusIcon.PENDING_CONNECTION && ( - - - - )} - - {cellState.icon === ConversationStatusIcon.UNREAD_MENTION && ( - - - - )} - - {cellState.icon === ConversationStatusIcon.UNREAD_REPLY && ( - - - - )} - - {cellState.icon === ConversationStatusIcon.UNREAD_PING && ( - - - - )} - - {cellState.icon === ConversationStatusIcon.MISSED_CALL && ( - - - - )} - - {cellState.icon === ConversationStatusIcon.MUTED && ( - - - - )} - - {cellState.icon === ConversationStatusIcon.UNREAD_MESSAGES && unreadState.allMessages.length > 0 && ( - - {unreadState.allMessages.length} - - )} - - )} + {!showJoinButton && } {showJoinButton && (