Revert "Various fixes for iOS (#1445)"

This reverts commit c06e0ecc797658dbc20371dd7efc68895d6d4900.
This commit is contained in:
Alexander Zinchuk 2021-09-16 20:08:49 +03:00
parent 60636a22de
commit a2f11c0468
4 changed files with 17 additions and 34 deletions

View File

@ -86,11 +86,8 @@ const VideoPlayer: FC<OwnProps> = ({
videoRef.current!.pause(); videoRef.current!.pause();
setIsPlayed(false); setIsPlayed(false);
} else { } else {
safePlay(videoRef.current!); videoRef.current!.play();
setIsPlayed(true); setIsPlayed(true);
if (IS_SINGLE_COLUMN_LAYOUT) {
setIsControlsVisible(false);
}
} }
}, [isPlayed]); }, [isPlayed]);
@ -111,7 +108,6 @@ const VideoPlayer: FC<OwnProps> = ({
const handleEnded = useCallback(() => { const handleEnded = useCallback(() => {
setCurrentTime(0); setCurrentTime(0);
setIsPlayed(false); setIsPlayed(false);
setIsControlsVisible(true);
}, []); }, []);
const handleFullscreenChange = useCallback(() => { const handleFullscreenChange = useCallback(() => {
@ -129,10 +125,6 @@ const VideoPlayer: FC<OwnProps> = ({
const toggleControls = useCallback((e: React.MouseEvent<HTMLDivElement>) => { const toggleControls = useCallback((e: React.MouseEvent<HTMLDivElement>) => {
e.stopPropagation(); e.stopPropagation();
setIsControlsVisible(!isControlsVisible); setIsControlsVisible(!isControlsVisible);
if (!isControlsVisible) {
videoRef.current!.pause();
setIsPlayed(false);
}
}, [isControlsVisible]); }, [isControlsVisible]);
useEffect(() => { useEffect(() => {
@ -157,8 +149,8 @@ const VideoPlayer: FC<OwnProps> = ({
<div <div
className="VideoPlayer" className="VideoPlayer"
onClick={!isGif && IS_SINGLE_COLUMN_LAYOUT ? toggleControls : undefined} onClick={!isGif && IS_SINGLE_COLUMN_LAYOUT ? toggleControls : undefined}
onMouseOver={!isGif && !IS_TOUCH_ENV ? handleMouseOver : undefined} onMouseOver={!isGif ? handleMouseOver : undefined}
onMouseOut={!isGif && !IS_TOUCH_ENV ? handleMouseOut : undefined} onMouseOut={!isGif ? handleMouseOut : undefined}
> >
<div <div
// @ts-ignore // @ts-ignore
@ -210,7 +202,7 @@ const VideoPlayer: FC<OwnProps> = ({
isFullscreen={isFullscreen} isFullscreen={isFullscreen}
fileSize={fileSize} fileSize={fileSize}
duration={videoRef.current ? videoRef.current.duration : 0} duration={videoRef.current ? videoRef.current.duration : 0}
isForceVisible={isControlsVisible} isForceVisible={!isPlayed || isControlsVisible}
isForceMobileVersion={posterSize && posterSize.width < MOBILE_VERSION_CONTROL_WIDTH} isForceMobileVersion={posterSize && posterSize.width < MOBILE_VERSION_CONTROL_WIDTH}
onSeek={handleSeek} onSeek={handleSeek}
onChangeFullscreen={handleFullscreenChange} onChangeFullscreen={handleFullscreenChange}

View File

@ -79,22 +79,18 @@
@media (max-width: 600px) { @media (max-width: 600px) {
margin-bottom: 4.25rem; margin-bottom: 4.25rem;
}
&.ActionMessage {
padding-bottom: 0.125rem;
}
}
}
@media (max-width: 600px) {
&.type-pinned .last-in-list {
@supports (padding-bottom: env(safe-area-inset-bottom)) { @supports (padding-bottom: env(safe-area-inset-bottom)) {
body:not(.keyboard-visible) & { body:not(.keyboard-visible) & {
margin-bottom: calc(4.25rem + env(safe-area-inset-bottom)); margin-bottom: calc(4.25rem + env(safe-area-inset-bottom));
} }
} }
} }
&.ActionMessage {
padding-bottom: 0.125rem;
}
}
} }
.Message, .Message,

View File

@ -19,9 +19,6 @@
.no-composer & { .no-composer & {
width: 100%; width: 100%;
@media (max-width: 600px) {
width: calc(100% - 1rem);
}
} }
@media (min-width: 601px) { @media (min-width: 601px) {

View File

@ -125,7 +125,6 @@ body.cursor-grabbing, body.cursor-grabbing * {
} }
} }
@media (min-width: 601px) {
.custom-scroll { .custom-scroll {
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: .375rem; width: .375rem;
@ -137,7 +136,6 @@ body.cursor-grabbing, body.cursor-grabbing * {
height: .35rem; height: .35rem;
} }
} }
}
.no-scrollbar { .no-scrollbar {
scrollbar-width: none; scrollbar-width: none;