Don't hide call controls when hovered
This commit is contained in:
parent
9012091d21
commit
fab883c2a6
1 changed files with 14 additions and 2 deletions
|
@ -122,6 +122,16 @@ export const CallScreen: React.FC<PropsType> = ({
|
||||||
}
|
}
|
||||||
}, [getPresentingSources, presentingSource, setPresenting]);
|
}, [getPresentingSources, presentingSource, setPresenting]);
|
||||||
|
|
||||||
|
const [controlsHover, setControlsHover] = useState(false);
|
||||||
|
|
||||||
|
const onControlsMouseEnter = useCallback(() => {
|
||||||
|
setControlsHover(true);
|
||||||
|
}, [setControlsHover]);
|
||||||
|
|
||||||
|
const onControlsMouseLeave = useCallback(() => {
|
||||||
|
setControlsHover(false);
|
||||||
|
}, [setControlsHover]);
|
||||||
|
|
||||||
const [acceptedDuration, setAcceptedDuration] = useState<number | null>(null);
|
const [acceptedDuration, setAcceptedDuration] = useState<number | null>(null);
|
||||||
const [showControls, setShowControls] = useState(true);
|
const [showControls, setShowControls] = useState(true);
|
||||||
|
|
||||||
|
@ -146,14 +156,14 @@ export const CallScreen: React.FC<PropsType> = ({
|
||||||
}, [joinedAt]);
|
}, [joinedAt]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!showControls || stickyControls) {
|
if (!showControls || stickyControls || controlsHover) {
|
||||||
return noop;
|
return noop;
|
||||||
}
|
}
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
setShowControls(false);
|
setShowControls(false);
|
||||||
}, 5000);
|
}, 5000);
|
||||||
return clearInterval.bind(null, timer);
|
return clearInterval.bind(null, timer);
|
||||||
}, [showControls, stickyControls]);
|
}, [showControls, stickyControls, controlsHover]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event: KeyboardEvent): void => {
|
const handleKeyDown = (event: KeyboardEvent): void => {
|
||||||
|
@ -370,6 +380,8 @@ export const CallScreen: React.FC<PropsType> = ({
|
||||||
'module-ongoing-call__footer__actions',
|
'module-ongoing-call__footer__actions',
|
||||||
controlsFadeClass
|
controlsFadeClass
|
||||||
)}
|
)}
|
||||||
|
onMouseEnter={onControlsMouseEnter}
|
||||||
|
onMouseLeave={onControlsMouseLeave}
|
||||||
>
|
>
|
||||||
<CallingButton
|
<CallingButton
|
||||||
buttonType={presentingButtonType}
|
buttonType={presentingButtonType}
|
||||||
|
|
Loading…
Reference in a new issue