Context menu for left pane list items
This commit is contained in:
parent
02dedc7157
commit
f61d8f38b0
43 changed files with 1046 additions and 110 deletions
|
@ -64,6 +64,7 @@ type ContactRowType = {
|
|||
type: RowType.Contact;
|
||||
contact: ContactListItemPropsType;
|
||||
isClickable?: boolean;
|
||||
hasContextMenu?: boolean;
|
||||
};
|
||||
|
||||
type ContactCheckboxRowType = {
|
||||
|
@ -175,12 +176,16 @@ export type PropsType = {
|
|||
i18n: LocalizerType;
|
||||
theme: ThemeType;
|
||||
|
||||
blockConversation: (conversationId: string) => void;
|
||||
onClickArchiveButton: () => void;
|
||||
onClickContactCheckbox: (
|
||||
conversationId: string,
|
||||
disabledReason: undefined | ContactCheckboxDisabledReason
|
||||
) => void;
|
||||
onSelectConversation: (conversationId: string, messageId?: string) => void;
|
||||
onOutgoingAudioCallInConversation: (conversationId: string) => void;
|
||||
onOutgoingVideoCallInConversation: (conversationId: string) => void;
|
||||
removeConversation?: (conversationId: string) => void;
|
||||
renderMessageSearchResult?: (id: string) => JSX.Element;
|
||||
showChooseGroupMembers: () => void;
|
||||
showConversation: ShowConversationType;
|
||||
|
@ -195,9 +200,13 @@ export function ConversationList({
|
|||
getPreferredBadge,
|
||||
getRow,
|
||||
i18n,
|
||||
blockConversation,
|
||||
onClickArchiveButton,
|
||||
onClickContactCheckbox,
|
||||
onSelectConversation,
|
||||
onOutgoingAudioCallInConversation,
|
||||
onOutgoingVideoCallInConversation,
|
||||
removeConversation,
|
||||
renderMessageSearchResult,
|
||||
rowCount,
|
||||
scrollBehavior = ScrollBehavior.Default,
|
||||
|
@ -266,7 +275,7 @@ export function ConversationList({
|
|||
result = undefined;
|
||||
break;
|
||||
case RowType.Contact: {
|
||||
const { isClickable = true } = row;
|
||||
const { isClickable = true, hasContextMenu = false } = row;
|
||||
result = (
|
||||
<ContactListItem
|
||||
{...row.contact}
|
||||
|
@ -274,6 +283,15 @@ export function ConversationList({
|
|||
onClick={isClickable ? onSelectConversation : undefined}
|
||||
i18n={i18n}
|
||||
theme={theme}
|
||||
hasContextMenu={hasContextMenu}
|
||||
onAudioCall={
|
||||
isClickable ? onOutgoingAudioCallInConversation : undefined
|
||||
}
|
||||
onVideoCall={
|
||||
isClickable ? onOutgoingVideoCallInConversation : undefined
|
||||
}
|
||||
onBlock={isClickable ? blockConversation : undefined}
|
||||
onRemove={isClickable ? removeConversation : undefined}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
|
@ -343,6 +361,7 @@ export function ConversationList({
|
|||
'muteExpiresAt',
|
||||
'phoneNumber',
|
||||
'profileName',
|
||||
'removalStage',
|
||||
'sharedGroupNames',
|
||||
'shouldShowDraft',
|
||||
'title',
|
||||
|
@ -452,18 +471,22 @@ export function ConversationList({
|
|||
);
|
||||
},
|
||||
[
|
||||
blockConversation,
|
||||
getPreferredBadge,
|
||||
getRow,
|
||||
i18n,
|
||||
lookupConversationWithoutUuid,
|
||||
onClickArchiveButton,
|
||||
onClickContactCheckbox,
|
||||
onOutgoingAudioCallInConversation,
|
||||
onOutgoingVideoCallInConversation,
|
||||
onSelectConversation,
|
||||
lookupConversationWithoutUuid,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
removeConversation,
|
||||
renderMessageSearchResult,
|
||||
setIsFetchingUUID,
|
||||
showChooseGroupMembers,
|
||||
showConversation,
|
||||
showUserNotFoundModal,
|
||||
theme,
|
||||
]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue