From d0ba24a328e7fc27370c449cce49cdc14cff2efe Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 15 Sep 2022 10:17:52 +0200 Subject: [PATCH] UI Loader: Fixes for preload animation --- src/components/common/UiLoader.module.scss | 14 ++++++++++---- src/components/common/UiLoader.tsx | 13 +++++++++---- src/components/main/LockScreen.tsx | 5 ++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/common/UiLoader.module.scss b/src/components/common/UiLoader.module.scss index f4ffb0761..d731abb30 100644 --- a/src/components/common/UiLoader.module.scss +++ b/src/components/common/UiLoader.module.scss @@ -1,7 +1,8 @@ -.root { +.bg { height: 100%; background-color: var(--theme-background-color); + background-position: center; background-repeat: no-repeat; background-size: 100% 100%; @@ -48,8 +49,12 @@ height: 100%; z-index: var(--z-ui-loader-mask); display: flex; +} - @media (min-width: 600px) { +.main { + flex: 1; + + @media (min-width: 926px) { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 100%; @@ -62,6 +67,7 @@ min-width: 12rem; width: 33vw; max-width: 26.5rem; + height: 100%; @media (min-width: 926px) { max-width: 40vw; @@ -89,10 +95,10 @@ .middle { flex: 3; border-left: 1px solid var(--color-borders); - border-right: 1px solid var(--color-borders); position: relative; z-index: 1; overflow: hidden; + background-size: cover !important; @media (max-width: 1275px) { border-right: none; @@ -116,5 +122,5 @@ .blank { flex: 1; - background: var(--color-background); + background-color: var(--color-background); } diff --git a/src/components/common/UiLoader.tsx b/src/components/common/UiLoader.tsx index baa918768..1cea77eb8 100644 --- a/src/components/common/UiLoader.tsx +++ b/src/components/common/UiLoader.tsx @@ -29,6 +29,7 @@ import monkeyPath from '../../assets/monkey.svg'; export type UiLoaderPage = 'main' | 'lock' + | 'inactive' | 'authCode' | 'authPassword' | 'authPhoneNumber' @@ -89,6 +90,8 @@ const preloadTasks = { preloadFonts(), preloadImage(lockPreviewPath), ]), + inactive: () => { + }, }; const UiLoader: FC = ({ @@ -144,21 +147,23 @@ const UiLoader: FC = ({ return (
{children} {shouldRenderMask && !shouldSkipHistoryAnimations && Boolean(page) && (
{page === 'main' ? ( - <> +
-
+
{isRightColumnShown &&
} - +
+ ) : (page === 'inactive' || page === 'lock') ? ( +
) : (
)} diff --git a/src/components/main/LockScreen.tsx b/src/components/main/LockScreen.tsx index ca7abd3ff..8baa337d3 100644 --- a/src/components/main/LockScreen.tsx +++ b/src/components/main/LockScreen.tsx @@ -8,7 +8,6 @@ import type { GlobalState } from '../../global/types'; import { LOCAL_TGS_URLS } from '../common/helpers/animatedAssets'; import useLang from '../../hooks/useLang'; -import buildClassName from '../../util/buildClassName'; import { decryptSession } from '../../util/passcode'; import useShowTransition from '../../hooks/useShowTransition'; import useTimeout from '../../hooks/useTimeout'; @@ -55,7 +54,7 @@ const LockScreen: FC = ({ const [validationError, setValidationError] = useState(''); const [shouldShowPasscode, setShouldShowPasscode] = useState(false); const [isSignOutDialogOpen, openSignOutConfirmation, closeSignOutConfirmation] = useFlag(false); - const { transitionClassNames, shouldRender } = useShowTransition(isLocked); + const { shouldRender } = useShowTransition(isLocked); useTimeout( resetInvalidUnlockAttempts, @@ -115,7 +114,7 @@ const LockScreen: FC = ({ } return ( -
+