From 8ea8889a8ea18ea00e0193dd56540647ebe84af0 Mon Sep 17 00:00:00 2001 From: Linh Vo Date: Wed, 29 Jan 2025 15:39:20 +0700 Subject: [PATCH 1/2] fix: login page auto scroll to top after change language --- src/pages/signin/SignInPageLayout/index.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/index.tsx b/src/pages/signin/SignInPageLayout/index.tsx index 3517edf9b847..fb11579802ff 100644 --- a/src/pages/signin/SignInPageLayout/index.tsx +++ b/src/pages/signin/SignInPageLayout/index.tsx @@ -73,14 +73,6 @@ function SignInPageLayout( scrollPageToTop, })); - useEffect(() => { - if (prevPreferredLocale !== preferredLocale) { - return; - } - - scrollPageToTop(); - }, [welcomeHeader, welcomeText, prevPreferredLocale, preferredLocale]); - const scrollViewStyles = useMemo(() => scrollViewContentContainerStyles(styles), [styles]); const backgroundImageHeight = Math.max(variables.signInContentMinHeight, containerHeight); From aeebfbff69523dde6fac5fbee5da80bd455f770f Mon Sep 17 00:00:00 2001 From: Linh Vo Date: Wed, 29 Jan 2025 15:51:56 +0700 Subject: [PATCH 2/2] fix: eslint fail --- src/pages/signin/SignInPageLayout/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/pages/signin/SignInPageLayout/index.tsx b/src/pages/signin/SignInPageLayout/index.tsx index fb11579802ff..d03d7459ac7f 100644 --- a/src/pages/signin/SignInPageLayout/index.tsx +++ b/src/pages/signin/SignInPageLayout/index.tsx @@ -6,15 +6,13 @@ import {View} from 'react-native'; import SignInGradient from '@assets/images/home-fade-gradient.svg'; import ImageSVG from '@components/ImageSVG'; import ScrollView from '@components/ScrollView'; -import useLocalize from '@hooks/useLocalize'; -import usePrevious from '@hooks/usePrevious'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useSafeAreaInsets from '@hooks/useSafeAreaInsets'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; -import * as Browser from '@libs/Browser'; +import {isMobileSafari} from '@libs/Browser'; import DomUtils from '@libs/DomUtils'; import getPlatform from '@libs/getPlatform'; // eslint-disable-next-line no-restricted-imports @@ -44,10 +42,8 @@ function SignInPageLayout( const theme = useTheme(); const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); - const {preferredLocale} = useLocalize(); const {top: topInsets, bottom: bottomInsets} = useSafeAreaInsets(); const scrollViewRef = useRef(null); - const prevPreferredLocale = usePrevious(preferredLocale); const {windowHeight} = useWindowDimensions(); const {shouldUseNarrowLayout, isMediumScreenWidth, isLargeScreenWidth} = useResponsiveLayout(); @@ -166,7 +162,7 @@ function SignInPageLayout( style={[ styles.flex1, styles.flexColumn, - Browser.isMobileSafari() ? styles.overflowHidden : {}, + isMobileSafari() ? styles.overflowHidden : {}, StyleUtils.getMinimumHeight(backgroundImageHeight), StyleUtils.getSignInBgStyles(theme), ]}