Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap the login page background image in a new container to fix it moving #34958

Merged
merged 16 commits into from
Feb 8, 2024
Merged
18 changes: 11 additions & 7 deletions src/pages/signin/SignInPageLayout/index.js
shahinyan11 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading