Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion assets/images/home-background--android.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/images/home-background--desktop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/images/home-background--ios.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/images/home-background--mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {Image} from 'expo-image';
import React, {useEffect, useState} from 'react';
import type {ImageSourcePropType} from 'react-native';
import {InteractionManager} from 'react-native';
import type {ImageSourcePropType} from 'react-native';
import Reanimated, {Easing, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated';
import MobileBackgroundImage from '@assets/images/home-background--ios.svg';
import MobileBackgroundImage from '@assets/images/home-background--mobile.svg';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import {isAnonymousUser} from '@libs/actions/Session';
import CONST from '@src/CONST';
import {useSplashScreenStateContext} from '@src/SplashScreenStateContext';
import type BackgroundImageProps from './types';

function BackgroundImage({width, transitionDuration}: BackgroundImageProps) {
function BackgroundImage({width}: BackgroundImageProps) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const [isInteractionComplete, setIsInteractionComplete] = useState(false);
Expand Down Expand Up @@ -57,8 +57,9 @@ function BackgroundImage({width, transitionDuration}: BackgroundImageProps) {
<Image
source={MobileBackgroundImage as ImageSourcePropType}
onLoadEnd={() => setOpacityAnimation()}
pointerEvents="none"
style={[styles.signInBackground, StyleUtils.getWidthStyle(width)]}
transition={transitionDuration}
transition={CONST.BACKGROUND_IMAGE_TRANSITION_DURATION}
/>
</Reanimated.View>
);
Expand Down
5 changes: 3 additions & 2 deletions src/pages/signin/SignInPageLayout/BackgroundImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {InteractionManager} from 'react-native';
import Animated, {FadeIn} from 'react-native-reanimated';
import useThemeStyles from '@hooks/useThemeStyles';
import {isAnonymousUser} from '@libs/actions/Session';
import CONST from '@src/CONST';
import type BackgroundImageProps from './types';

const BackgroundMobile = lazy(() =>
Expand All @@ -16,7 +17,7 @@ const BackgroundDesktop = lazy(() =>
})),
);

function BackgroundImage({width, transitionDuration, isSmallScreen = false}: BackgroundImageProps) {
function BackgroundImage({width, isSmallScreen = false}: BackgroundImageProps) {
const styles = useThemeStyles();
const [isInteractionComplete, setIsInteractionComplete] = useState(false);
const isAnonymous = isAnonymousUser();
Expand Down Expand Up @@ -52,7 +53,7 @@ function BackgroundImage({width, transitionDuration, isSmallScreen = false}: Bac
<Suspense fallback={null}>
<Animated.View
style={styles.signInBackground}
entering={FadeIn.duration(transitionDuration)}
entering={FadeIn.duration(CONST.BACKGROUND_IMAGE_TRANSITION_DURATION)}
>
<BackgroundComponent width={width} />
</Animated.View>
Expand Down
6 changes: 0 additions & 6 deletions src/pages/signin/SignInPageLayout/BackgroundImage/types.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
type BackgroundImageProps = {
/** pointerEvents property to the SVG element */
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto';

/** The width of the image. */
width: number;

/** Is the window width narrow, like on a mobile device */
isSmallScreen?: boolean;

/** Transition duration in milliseconds */
transitionDuration: number;
};

export default BackgroundImageProps;
2 changes: 1 addition & 1 deletion src/pages/signin/SignInPageLayout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function Footer({navigateFocus}: FooterProps) {
<View style={[styles.flex1]}>
<View style={footerWrapper}>
{isVertical ? (
<View style={[styles.signInPageGradientMobile]}>
<View style={styles.signInPageGradientMobile}>
<ImageSVG
src={SignInGradient}
height="100%"
Expand Down
16 changes: 2 additions & 14 deletions src/pages/signin/SignInPageLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ function SignInPageLayout({
<View style={styles.signInPageHeroCenter}>
<BackgroundImage
isSmallScreen={false}
pointerEvents="none"
width={variables.signInHeroBackgroundWidth}
transitionDuration={CONST.BACKGROUND_IMAGE_TRANSITION_DURATION}
/>
</View>
<View>
Expand Down Expand Up @@ -155,21 +153,11 @@ function SignInPageLayout({
keyboardShouldPersistTaps="handled"
ref={scrollViewRef}
>
<View
style={[
styles.flex1,
styles.flexColumn,
isMobileSafari() ? styles.overflowHidden : {},
StyleUtils.getMinimumHeight(backgroundImageHeight),
StyleUtils.getSignInBgStyles(theme),
]}
>
<View style={[styles.pAbsolute, styles.w100, StyleUtils.getHeight(backgroundImageHeight), StyleUtils.getBackgroundColorStyle(theme.highlightBG)]}>
<View style={[styles.flex1, styles.flexColumn, isMobileSafari() ? styles.overflowHidden : {}, StyleUtils.getMinimumHeight(backgroundImageHeight)]}>
<View style={[styles.pAbsolute, styles.b0, styles.w100, StyleUtils.getHeight(backgroundImageHeight), StyleUtils.getBackgroundColorStyle(theme.highlightBG)]}>
<BackgroundImage
isSmallScreen
pointerEvents="none"
width={variables.signInHeroBackgroundWidthMobile}
transitionDuration={CONST.BACKGROUND_IMAGE_TRANSITION_DURATION}
/>
</View>
<SignInPageContent
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ const staticStyles = (theme: ThemeColors) =>

signInPageGradientMobile: {
height: 300,
width: 800,
width: '100%',
position: 'absolute',
top: 0,
left: 0,
Expand Down
7 changes: 0 additions & 7 deletions src/styles/utils/getSignInBgStyles/index.ios.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/styles/utils/getSignInBgStyles/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/styles/utils/getSignInBgStyles/types.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/styles/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import getMoneyRequestReportPreviewStyle from './getMoneyRequestReportPreviewSty
import getNavigationBarType from './getNavigationBarType/index';
import getNavigationModalCardStyle from './getNavigationModalCardStyles';
import getSafeAreaInsets from './getSafeAreaInsets';
import getSignInBgStyles from './getSignInBgStyles';
import getSuccessReportCardLostIllustrationStyle from './getSuccessReportCardLostIllustrationStyle';
import {compactContentContainerStyles} from './optionRowStyles';
import positioning from './positioning';
Expand Down Expand Up @@ -1330,7 +1329,6 @@ const staticStyleUtils = {
getSearchPageNarrowHeaderStyles,
getOpacityStyle,
getMultiGestureCanvasContainerStyle,
getSignInBgStyles,
getIconWidthAndHeightStyle,
getButtonStyleWithIcon,
getCharacterWidth,
Expand Down
Loading