diff --git a/patches/lottie-react-native+6.3.1.patch b/patches/lottie-react-native+6.3.1.patch deleted file mode 100644 index 163ee6fd621e..000000000000 --- a/patches/lottie-react-native+6.3.1.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/node_modules/lottie-react-native/src/LottieView.tsx b/node_modules/lottie-react-native/src/LottieView.tsx -index 6372ca2..c5cfad7 100644 ---- a/node_modules/lottie-react-native/src/LottieView.tsx -+++ b/node_modules/lottie-react-native/src/LottieView.tsx -@@ -4,6 +4,7 @@ import { - NativeSyntheticEvent, - ViewProps, - processColor, -+ StyleSheet, - } from 'react-native'; - - import type { LottieViewProps } from './LottieView.types'; -@@ -12,7 +13,7 @@ import NativeLottieAnimationView, { - Commands, - } from './specs/LottieAnimationViewNativeComponent'; - --type Props = LottieViewProps & { containerProps?: ViewProps }; -+type Props = LottieViewProps & { containerProps?: ViewProps; autoSize?: boolean }; - - const defaultProps: Props = { - source: undefined, -@@ -27,6 +28,7 @@ const defaultProps: Props = { - colorFilters: [], - textFiltersAndroid: [], - textFiltersIOS: [], -+ autoSize: false, - }; - - export class LottieView extends React.PureComponent { -@@ -132,6 +134,7 @@ export class LottieView extends React.PureComponent { - textFiltersAndroid, - textFiltersIOS, - resizeMode, -+ autoSize, - ...rest - } = this.props; - -@@ -149,6 +152,22 @@ export class LottieView extends React.PureComponent { - color: processColor(colorFilter.color), - })); - -+ const aspectRatioStyle = sources.sourceJson -+ ? { aspectRatio: (source as any).w / (source as any).h } -+ : undefined; -+ -+ const styleObject = StyleSheet.flatten(style); -+ let sizeStyle; -+ if ( -+ !styleObject || -+ (styleObject.width === undefined && styleObject.height === undefined) -+ ) { -+ sizeStyle = -+ autoSize && sources.sourceJson -+ ? { width: (source as any).w } -+ : StyleSheet.absoluteFill; -+ } -+ - return ( - { - textFiltersAndroid={textFiltersAndroid} - textFiltersIOS={textFiltersIOS} - speed={speed} -- style={style} -+ style={[ -+ aspectRatioStyle, -+ sizeStyle, -+ style, -+ ]} - onAnimationFinish={this.onAnimationFinish} - onAnimationFailure={this.onAnimationFailure} - autoPlay={autoPlay} diff --git a/src/components/ConfirmationPage.js b/src/components/ConfirmationPage.js index ffa3c780f154..c542f3d9a8c7 100644 --- a/src/components/ConfirmationPage.js +++ b/src/components/ConfirmationPage.js @@ -46,7 +46,7 @@ function ConfirmationPage(props) { source={props.animation} autoPlay loop - style={styles.confirmationAnimation} + style={[styles.confirmationAnimation, styles.aspectRatioLottie(props.animation)]} /> {props.heading} {props.description} diff --git a/src/components/IllustratedHeaderPageLayout.js b/src/components/IllustratedHeaderPageLayout.js index ac916117094b..0837941691ca 100644 --- a/src/components/IllustratedHeaderPageLayout.js +++ b/src/components/IllustratedHeaderPageLayout.js @@ -40,7 +40,7 @@ function IllustratedHeaderPageLayout({backgroundColor, children, illustration, f <> diff --git a/src/components/ReimbursementAccountLoadingIndicator.js b/src/components/ReimbursementAccountLoadingIndicator.js index 21aac35f4005..58390bed9b08 100644 --- a/src/components/ReimbursementAccountLoadingIndicator.js +++ b/src/components/ReimbursementAccountLoadingIndicator.js @@ -38,7 +38,7 @@ function ReimbursementAccountLoadingIndicator(props) { source={LottieAnimations.ReviewingBankInfo} autoPlay loop - style={styles.loadingVBAAnimation} + style={[styles.loadingVBAAnimation, styles.aspectRatioLottie(LottieAnimations.ReviewingBankInfo)]} /> {translate('reimbursementAccountLoadingAnimation.explanationLine')} diff --git a/src/pages/signin/SignInHeroImage.js b/src/pages/signin/SignInHeroImage.js index e67497a20e15..90d24a822b49 100644 --- a/src/pages/signin/SignInHeroImage.js +++ b/src/pages/signin/SignInHeroImage.js @@ -33,7 +33,7 @@ function SignInHeroImage(props) { source={LottieAnimations.Hands} loop autoPlay - style={[styles.alignSelfCenter, imageSize]} + style={[styles.alignSelfCenter, imageSize, styles.aspectRatioLottie(LottieAnimations.Hands)]} /> ); } diff --git a/src/styles/styles.js b/src/styles/styles.js index 7bba63c8f09f..9fe74bd2243b 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -3694,6 +3694,13 @@ const styles = (theme) => ({ fontSize: variables.fontSizeSmall, lineHeight: variables.lineHeightLarge, }, + + aspectRatioLottie: (source) => { + if (typeof source === 'object' && !source.uri) { + return {aspectRatio: source.w / source.h}; + } + return {aspectRatio: '1'}; + }, }); // For now we need to export the styles function that takes the theme as an argument