Preload conversation open data
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
6ea47d9c6b
commit
7db33a6708
14 changed files with 332 additions and 89 deletions
|
@ -50,6 +50,7 @@ type PropsType = {
|
|||
messageText?: ReactNode;
|
||||
messageTextIsAlwaysFullSize?: boolean;
|
||||
onClick?: () => void;
|
||||
onMouseDown?: () => void;
|
||||
shouldShowSpinner?: boolean;
|
||||
unreadCount?: number;
|
||||
unreadMentionsCount?: number;
|
||||
|
@ -100,6 +101,7 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
|
|||
messageText,
|
||||
messageTextIsAlwaysFullSize,
|
||||
onClick,
|
||||
onMouseDown,
|
||||
phoneNumber,
|
||||
profileName,
|
||||
sharedGroupNames,
|
||||
|
@ -289,6 +291,7 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
|
|||
data-testid={testId}
|
||||
disabled={disabled}
|
||||
onClick={onClick}
|
||||
onMouseDown={onMouseDown}
|
||||
type="button"
|
||||
>
|
||||
{contents}
|
||||
|
|
|
@ -74,6 +74,7 @@ type PropsHousekeeping = {
|
|||
buttonAriaLabel?: string;
|
||||
i18n: LocalizerType;
|
||||
onClick: (id: string) => void;
|
||||
onMouseDown: (id: string) => void;
|
||||
theme: ThemeType;
|
||||
};
|
||||
|
||||
|
@ -98,6 +99,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
markedUnread,
|
||||
muteExpiresAt,
|
||||
onClick,
|
||||
onMouseDown,
|
||||
phoneNumber,
|
||||
profileName,
|
||||
removalStage,
|
||||
|
@ -202,6 +204,10 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
}
|
||||
|
||||
const onClickItem = useCallback(() => onClick(id), [onClick, id]);
|
||||
const onMouseDownItem = useCallback(
|
||||
() => onMouseDown(id),
|
||||
[onMouseDown, id]
|
||||
);
|
||||
|
||||
return (
|
||||
<BaseConversationListItem
|
||||
|
@ -223,6 +229,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
messageText={messageText}
|
||||
messageTextIsAlwaysFullSize
|
||||
onClick={onClickItem}
|
||||
onMouseDown={onMouseDownItem}
|
||||
phoneNumber={phoneNumber}
|
||||
profileName={profileName}
|
||||
sharedGroupNames={sharedGroupNames}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue