From a2f11c0468e8b08c25f90c13c9622b7f1ad51bb3 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 16 Sep 2021 20:08:49 +0300 Subject: [PATCH] Revert "Various fixes for iOS (#1445)" This reverts commit c06e0ecc797658dbc20371dd7efc68895d6d4900. --- src/components/mediaViewer/VideoPlayer.tsx | 16 ++++------------ src/components/middle/MessageList.scss | 16 ++++++---------- src/components/middle/MessageSelectToolbar.scss | 3 --- src/styles/index.scss | 16 +++++++--------- 4 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/components/mediaViewer/VideoPlayer.tsx b/src/components/mediaViewer/VideoPlayer.tsx index 5bd43a736..215f88364 100644 --- a/src/components/mediaViewer/VideoPlayer.tsx +++ b/src/components/mediaViewer/VideoPlayer.tsx @@ -86,11 +86,8 @@ const VideoPlayer: FC = ({ videoRef.current!.pause(); setIsPlayed(false); } else { - safePlay(videoRef.current!); + videoRef.current!.play(); setIsPlayed(true); - if (IS_SINGLE_COLUMN_LAYOUT) { - setIsControlsVisible(false); - } } }, [isPlayed]); @@ -111,7 +108,6 @@ const VideoPlayer: FC = ({ const handleEnded = useCallback(() => { setCurrentTime(0); setIsPlayed(false); - setIsControlsVisible(true); }, []); const handleFullscreenChange = useCallback(() => { @@ -129,10 +125,6 @@ const VideoPlayer: FC = ({ const toggleControls = useCallback((e: React.MouseEvent) => { e.stopPropagation(); setIsControlsVisible(!isControlsVisible); - if (!isControlsVisible) { - videoRef.current!.pause(); - setIsPlayed(false); - } }, [isControlsVisible]); useEffect(() => { @@ -157,8 +149,8 @@ const VideoPlayer: FC = ({
= ({ isFullscreen={isFullscreen} fileSize={fileSize} duration={videoRef.current ? videoRef.current.duration : 0} - isForceVisible={isControlsVisible} + isForceVisible={!isPlayed || isControlsVisible} isForceMobileVersion={posterSize && posterSize.width < MOBILE_VERSION_CONTROL_WIDTH} onSeek={handleSeek} onChangeFullscreen={handleFullscreenChange} diff --git a/src/components/middle/MessageList.scss b/src/components/middle/MessageList.scss index 9e80fa5f6..84a274d53 100644 --- a/src/components/middle/MessageList.scss +++ b/src/components/middle/MessageList.scss @@ -79,6 +79,12 @@ @media (max-width: 600px) { margin-bottom: 4.25rem; + + @supports (padding-bottom: env(safe-area-inset-bottom)) { + body:not(.keyboard-visible) & { + margin-bottom: calc(4.25rem + env(safe-area-inset-bottom)); + } + } } &.ActionMessage { @@ -87,16 +93,6 @@ } } - @media (max-width: 600px) { - &.type-pinned .last-in-list { - @supports (padding-bottom: env(safe-area-inset-bottom)) { - body:not(.keyboard-visible) & { - margin-bottom: calc(4.25rem + env(safe-area-inset-bottom)); - } - } - } - } - .Message, .ActionMessage { position: relative; diff --git a/src/components/middle/MessageSelectToolbar.scss b/src/components/middle/MessageSelectToolbar.scss index daa3a5085..695ddbe53 100644 --- a/src/components/middle/MessageSelectToolbar.scss +++ b/src/components/middle/MessageSelectToolbar.scss @@ -19,9 +19,6 @@ .no-composer & { width: 100%; - @media (max-width: 600px) { - width: calc(100% - 1rem); - } } @media (min-width: 601px) { diff --git a/src/styles/index.scss b/src/styles/index.scss index d697ac75b..c1ed0e1fa 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -125,17 +125,15 @@ body.cursor-grabbing, body.cursor-grabbing * { } } -@media (min-width: 601px) { - .custom-scroll { - &::-webkit-scrollbar { - width: .375rem; - } +.custom-scroll { + &::-webkit-scrollbar { + width: .375rem; } +} - .custom-scroll-x { - &::-webkit-scrollbar { - height: .35rem; - } +.custom-scroll-x { + &::-webkit-scrollbar { + height: .35rem; } }