-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Upgrade lottie-react-native to 6.3.1 #28267
Changes from 11 commits
c0b5f21
4b1e93f
d9ff6fa
7393ec5
65383b6
4c6d87a
32431f4
cd253bb
2d3bfdc
0e8bd09
4b6c82a
4123599
1c08452
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React, {forwardRef} from 'react'; | ||
import LottieView, {LottieViewProps} from 'lottie-react-native'; | ||
import styles from '../../styles/styles'; | ||
|
||
const Lottie = forwardRef<LottieView, LottieViewProps>((props: LottieViewProps, ref) => ( | ||
<LottieView | ||
// eslint-disable-next-line | ||
{...props} | ||
ref={ref} | ||
style={[styles.aspectRatioLottie(props.source), props.style]} | ||
/> | ||
)); | ||
|
||
export default Lottie; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Lottie from './Lottie'; | ||
|
||
export default Lottie; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3779,6 +3779,13 @@ const styles = (theme) => ({ | |||||
lineHeight: variables.lineHeightLarge, | ||||||
}, | ||||||
|
||||||
aspectRatioLottie: (source) => { | ||||||
if (typeof source === 'object' && !source.uri) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add more safety condition here, though all Lottie JSON may include
Suggested change
|
||||||
return {aspectRatio: source.w / source.h}; | ||||||
} | ||||||
return {aspectRatio: '1'}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer setting this undefined and let user fully customize style properties.
Suggested change
|
||||||
}, | ||||||
|
||||||
receiptDropHeaderGap: { | ||||||
backgroundColor: theme.receiptDropUIBG, | ||||||
}, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
Lottie.tsx
is written in TS andindex.js
in JS? I think Lottie catalog can be removed andLottie.tsx
file incomponents
catalog should be sufficient.@ZhenjaHorbach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already existing pattern, i.e. MapView but agree to write TS for all
Agree. Unless platform specific or has propTypes in js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the first point, I did it by analogy with other catalogs)
And about the second one, maybe you're right
Seems a little redundant
Should I create a new PR?