Skip to content

Commit

Permalink
Merge pull request #34958 from shahinyan11/issues/34529
Browse files Browse the repository at this point in the history
Wrap the login page background image in a new container to fix it moving
  • Loading branch information
rlinoz authored Feb 8, 2024
2 parents 2988851 + 084eafd commit a08b2b9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/pages/signin/SignInPageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ function SignInPageLayout(props) {

const scrollViewStyles = useMemo(() => scrollViewContentContainerStyles(styles), [styles]);

const backgroundImageHeight = Math.max(variables.signInContentMinHeight, containerHeight);

return (
<View style={containerStyles}>
{!props.shouldShowSmallScreen ? (
Expand Down Expand Up @@ -163,13 +165,15 @@ function SignInPageLayout(props) {
keyboardShouldPersistTaps="handled"
ref={scrollViewRef}
>
<View style={[styles.flex1, styles.flexColumn, styles.overflowHidden, StyleUtils.getMinimumHeight(Math.max(variables.signInContentMinHeight, containerHeight))]}>
<BackgroundImage
isSmallScreen
pointerEvents="none"
width={variables.signInHeroBackgroundWidthMobile}
transitionDuration={CONST.BACKGROUND_IMAGE_TRANSITION_DURATION}
/>
<View style={[styles.flex1, styles.flexColumn, styles.overflowHidden, StyleUtils.getMinimumHeight(backgroundImageHeight), StyleUtils.getSignInBgStyles(theme)]}>
<View style={[styles.pAbsolute, styles.w100, StyleUtils.getHeight(backgroundImageHeight), StyleUtils.getBackgroundColorStyle(theme.highlightBG)]}>
<BackgroundImage
isSmallScreen
pointerEvents="none"
width={variables.signInHeroBackgroundWidthMobile}
transitionDuration={CONST.BACKGROUND_IMAGE_TRANSITION_DURATION}
/>
</View>
<SignInPageContent
welcomeHeader={props.welcomeHeader}
welcomeText={props.welcomeText}
Expand Down
7 changes: 7 additions & 0 deletions src/styles/utils/getSignInBgStyles/index.ios.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type GetSignInBgStyles from './types';

const getSignInBgStyles: GetSignInBgStyles = (theme) => ({
backgroundColor: theme.signInPage,
});

export default getSignInBgStyles;
5 changes: 5 additions & 0 deletions src/styles/utils/getSignInBgStyles/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type GetSignInBgStyles from './types';

const getSignInBgStyles: GetSignInBgStyles = () => ({});

export default getSignInBgStyles;
6 changes: 6 additions & 0 deletions src/styles/utils/getSignInBgStyles/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type {ViewStyle} from 'react-native';
import type {ThemeColors} from '@styles/theme/types';

type GetSignInBgStyles = (theme: ThemeColors) => ViewStyle;

export default GetSignInBgStyles;
2 changes: 2 additions & 0 deletions src/styles/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import createReportActionContextMenuStyleUtils from './generators/ReportActionCo
import createTooltipStyleUtils from './generators/TooltipStyleUtils';
import getContextMenuItemStyles from './getContextMenuItemStyles';
import getNavigationModalCardStyle from './getNavigationModalCardStyles';
import getSignInBgStyles from './getSignInBgStyles';
import {compactContentContainerStyles} from './optionRowStyles';
import positioning from './positioning';
import type {
Expand Down Expand Up @@ -1084,6 +1085,7 @@ const staticStyleUtils = {
getCardStyles,
getOpacityStyle,
getMultiGestureCanvasContainerStyle,
getSignInBgStyles,
};

const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({
Expand Down

0 comments on commit a08b2b9

Please sign in to comment.