Skip to content

Commit 25ed435

Browse files
authored
Merge pull request #30772 from software-mansion-labs/@kosmydel/upgrade-lottie-6-4-0
Upgrade `lottie-react-native` to 6.4.0
2 parents d7f97bb + 6a9a9f2 commit 25ed435

9 files changed

+72
-50
lines changed

config/webpack/webpack.common.js

-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
187187
'react-native-config': 'react-web-config',
188188
'react-native$': '@expensify/react-native-web',
189189
'react-native-web': '@expensify/react-native-web',
190-
'lottie-react-native': 'react-native-web-lottie',
191190

192191
// Module alias for web & desktop
193192
// https://webpack.js.org/configuration/resolve/#resolvealias

package-lock.json

+50-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"setup-https": "mkcert -install && mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1"
5959
},
6060
"dependencies": {
61+
"@dotlottie/react-player": "^1.6.3",
6162
"@expensify/react-native-web": "0.18.15",
6263
"@formatjs/intl-datetimeformat": "^6.10.0",
6364
"@formatjs/intl-getcanonicallocales": "^2.2.0",
@@ -69,6 +70,7 @@
6970
"@invertase/react-native-apple-authentication": "^2.2.2",
7071
"@kie/act-js": "^2.0.1",
7172
"@kie/mock-github": "^1.0.0",
73+
"@lottiefiles/react-lottie-player": "^3.5.3",
7274
"@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52",
7375
"@onfido/react-native-sdk": "8.3.0",
7476
"@react-native-async-storage/async-storage": "^1.17.10",
@@ -105,7 +107,7 @@
105107
"idb-keyval": "^6.2.1",
106108
"jest-when": "^3.5.2",
107109
"lodash": "4.17.21",
108-
"lottie-react-native": "^6.3.1",
110+
"lottie-react-native": "^6.4.0",
109111
"mapbox-gl": "^2.15.0",
110112
"moment": "^2.29.4",
111113
"moment-timezone": "^0.5.31",
@@ -161,7 +163,6 @@
161163
"react-native-view-shot": "^3.6.0",
162164
"react-native-vision-camera": "^2.16.2",
163165
"react-native-web-linear-gradient": "^1.1.2",
164-
"react-native-web-lottie": "^1.4.4",
165166
"react-native-webview": "^11.17.2",
166167
"react-pdf": "^6.2.2",
167168
"react-plaid-link": "3.3.2",
@@ -174,8 +175,6 @@
174175
"underscore": "^1.13.1"
175176
},
176177
"devDependencies": {
177-
"@dword-design/eslint-plugin-import-alias": "^4.0.8",
178-
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
179178
"@actions/core": "1.10.0",
180179
"@actions/github": "5.1.1",
181180
"@babel/core": "^7.20.0",
@@ -186,6 +185,7 @@
186185
"@babel/preset-react": "^7.10.4",
187186
"@babel/preset-typescript": "^7.21.5",
188187
"@babel/runtime": "^7.20.0",
188+
"@dword-design/eslint-plugin-import-alias": "^4.0.8",
189189
"@electron/notarize": "^2.1.0",
190190
"@jest/globals": "^29.5.0",
191191
"@octokit/core": "4.0.4",
@@ -205,6 +205,7 @@
205205
"@svgr/webpack": "^6.0.0",
206206
"@testing-library/jest-native": "5.4.1",
207207
"@testing-library/react-native": "11.5.1",
208+
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
208209
"@types/concurrently": "^7.0.0",
209210
"@types/jest": "^29.5.2",
210211
"@types/jest-when": "^3.5.2",

patches/react-native-web-lottie+1.4.4.patch

-9
This file was deleted.

src/components/ConfirmationPage.js

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function ConfirmationPage(props) {
4747
autoPlay
4848
loop
4949
style={styles.confirmationAnimation}
50+
webStyle={styles.confirmationAnimationWeb}
5051
/>
5152
<Text style={[styles.textHeadline, styles.textAlignCenter, styles.mv2]}>{props.heading}</Text>
5253
<Text style={styles.textAlignCenter}>{props.description}</Text>

src/components/IllustratedHeaderPageLayout.js

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function IllustratedHeaderPageLayout({backgroundColor, children, illustration, f
4141
<Lottie
4242
source={illustration}
4343
style={styles.w100}
44+
webStyle={styles.w100}
4445
autoPlay
4546
loop
4647
/>

src/components/Lottie/Lottie.tsx

+13-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import LottieView, {LottieViewProps} from 'lottie-react-native';
22
import React, {forwardRef} from 'react';
33
import styles from '@styles/styles';
44

5-
const Lottie = forwardRef<LottieView, LottieViewProps>((props: LottieViewProps, ref) => (
6-
<LottieView
7-
// eslint-disable-next-line
8-
{...props}
9-
ref={ref}
10-
style={[styles.aspectRatioLottie(props.source), props.style]}
11-
/>
12-
));
5+
const Lottie = forwardRef<LottieView, LottieViewProps>((props: LottieViewProps, ref) => {
6+
const aspectRatioStyle = styles.aspectRatioLottie(props.source);
7+
8+
return (
9+
<LottieView
10+
// eslint-disable-next-line
11+
{...props}
12+
ref={ref}
13+
style={[aspectRatioStyle, props.style]}
14+
webStyle={{...aspectRatioStyle, ...props.webStyle}}
15+
/>
16+
);
17+
});
1318

1419
export default Lottie;

src/components/ReimbursementAccountLoadingIndicator.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function ReimbursementAccountLoadingIndicator(props) {
3939
autoPlay
4040
loop
4141
style={styles.loadingVBAAnimation}
42+
webStyle={styles.loadingVBAAnimationWeb}
4243
/>
4344
<View style={[styles.ph6]}>
4445
<Text style={[styles.textAlignCenter]}>{translate('reimbursementAccountLoadingAnimation.explanationLine')}</Text>

src/pages/signin/SignInHeroImage.js

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function SignInHeroImage(props) {
3434
loop
3535
autoPlay
3636
style={[styles.alignSelfCenter, imageSize]}
37+
webStyle={{...styles.alignSelfCenter, ...imageSize}}
3738
/>
3839
);
3940
}

0 commit comments

Comments
 (0)