Fix ContextMenuTrigger missing children
This commit is contained in:
parent
5bd287e707
commit
2dd2de4d0f
1 changed files with 38 additions and 35 deletions
|
@ -72,43 +72,46 @@ export const CallingNotification: React.FC<PropsType> = React.memo(
|
||||||
const icon = getCallingIcon(type, direction, status);
|
const icon = getCallingIcon(type, direction, status);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
|
||||||
onContextMenu={handleContextMenu}
|
|
||||||
// @ts-expect-error -- React/TS doesn't know about inert
|
|
||||||
// eslint-disable-next-line react/no-unknown-property
|
|
||||||
inert={props.isSelectMode ? '' : undefined}
|
|
||||||
>
|
|
||||||
<SystemMessage
|
|
||||||
button={renderCallingNotificationButton(props)}
|
|
||||||
contents={
|
|
||||||
<>
|
|
||||||
{getCallingNotificationText(props, i18n)} ·{' '}
|
|
||||||
<MessageTimestamp
|
|
||||||
direction="outgoing"
|
|
||||||
i18n={i18n}
|
|
||||||
timestamp={timestamp}
|
|
||||||
withImageNoCaption={false}
|
|
||||||
withSticker={false}
|
|
||||||
withTapToViewExpired={false}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
icon={icon}
|
|
||||||
kind={
|
|
||||||
status === DirectCallStatus.Missed ||
|
|
||||||
status === GroupCallStatus.Missed
|
|
||||||
? SystemMessageKind.Danger
|
|
||||||
: SystemMessageKind.Normal
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<ContextMenuTrigger
|
<ContextMenuTrigger
|
||||||
id={props.id}
|
id={props.id}
|
||||||
ref={ref => {
|
// react-contextmenu's typings are incorrect here
|
||||||
// react-contextmenu's typings are incorrect here
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
menuTriggerRef.current = ref as unknown as ContextMenuTriggerType;
|
ref={menuTriggerRef as any}
|
||||||
}}
|
disable={props.isSelectMode}
|
||||||
/>
|
// Immediately hide the context menu on outside click.
|
||||||
|
// This is a bug in react-contextmenu trying to handle touch events.
|
||||||
|
holdToDisplay={-1}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
// @ts-expect-error -- React/TS doesn't know about inert
|
||||||
|
// eslint-disable-next-line react/no-unknown-property
|
||||||
|
inert={props.isSelectMode ? '' : undefined}
|
||||||
|
>
|
||||||
|
<SystemMessage
|
||||||
|
button={renderCallingNotificationButton(props)}
|
||||||
|
contents={
|
||||||
|
<>
|
||||||
|
{getCallingNotificationText(props, i18n)} ·{' '}
|
||||||
|
<MessageTimestamp
|
||||||
|
direction="outgoing"
|
||||||
|
i18n={i18n}
|
||||||
|
timestamp={timestamp}
|
||||||
|
withImageNoCaption={false}
|
||||||
|
withSticker={false}
|
||||||
|
withTapToViewExpired={false}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
icon={icon}
|
||||||
|
kind={
|
||||||
|
status === DirectCallStatus.Missed ||
|
||||||
|
status === GroupCallStatus.Missed
|
||||||
|
? SystemMessageKind.Danger
|
||||||
|
: SystemMessageKind.Normal
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</ContextMenuTrigger>
|
||||||
<MessageContextMenu
|
<MessageContextMenu
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
triggerId={props.id}
|
triggerId={props.id}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue