Fix pip sliding down on click (#5147)

* Fix pip sliding down on click

* Add top margin to PiP intial position

Co-authored-by: Jost Schulte <jost@jibble.io>
This commit is contained in:
Jost Schulte
2021-04-06 00:06:11 +02:00
committed by GitHub
parent 79c94dafd5
commit 73a8c3ff95

View File

@@ -86,7 +86,7 @@ export const CallingPip = ({
const [windowHeight, setWindowHeight] = React.useState(window.innerHeight);
const [positionState, setPositionState] = React.useState<PositionState>({
mode: PositionMode.SnapToRight,
offsetY: 0,
offsetY: PIP_TOP_MARGIN,
});
React.useEffect(() => {
@@ -202,7 +202,7 @@ export const CallingPip = ({
return [
PIP_PADDING,
Math.min(
PIP_TOP_MARGIN + positionState.offsetY,
positionState.offsetY,
windowHeight - PIP_PADDING - PIP_HEIGHT
),
];
@@ -210,7 +210,7 @@ export const CallingPip = ({
return [
windowWidth - PIP_PADDING - PIP_WIDTH,
Math.min(
PIP_TOP_MARGIN + positionState.offsetY,
positionState.offsetY,
windowHeight - PIP_PADDING - PIP_HEIGHT
),
];