Merge pull request #17705 from Scroody/I-17703

Fix: Cameras don't obstruct buttons anymore.
This commit is contained in:
Ramón Souza 2023-04-26 15:13:35 -03:00 committed by GitHub
commit 6affbcc511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,13 @@ const WebcamComponent = ({
if (isRTL) { if (isRTL) {
draggableOffset.left = draggableOffset.left * -1; draggableOffset.left = draggableOffset.left * -1;
} }
const isIphone = !!(navigator.userAgent.match(/iPhone/i));
const mobileWidth = `${isDragging ? cameraSize.width : cameraDock.width}pt`;
const mobileHeight = `${isDragging ? cameraSize.height : cameraDock.height}pt`;
const isDesktopWidth = isDragging ? cameraSize.width : cameraDock.width;
const isDesktopHeight = isDragging ? cameraSize.height : cameraDock.height;
const camOpacity = isDragging ? 0.5 : undefined;
return ( return (
<> <>
{isDragging ? <DropAreaContainer /> : null} {isDragging ? <DropAreaContainer /> : null}
@ -236,9 +242,9 @@ const WebcamComponent = ({
role="region" role="region"
draggable={cameraDock.isDraggable && !isFullscreen ? 'true' : undefined} draggable={cameraDock.isDraggable && !isFullscreen ? 'true' : undefined}
style={{ style={{
width: `${isDragging ? cameraSize.width : cameraDock.width}pt`, width: isIphone ? mobileWidth : isDesktopWidth,
height: `${isDragging ? cameraSize.height : cameraDock.height}pt`, height: isIphone ? mobileHeight : isDesktopHeight,
opacity: isDragging ? 0.5 : undefined, opacity: camOpacity,
background: isCameraSidebar ? colorContentBackground : null, background: isCameraSidebar ? colorContentBackground : null,
}} }}
> >