-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat(celo-news): skeleton placeholder while loading #3274
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3274 +/- ##
=======================================
Coverage 80.57% 80.58%
=======================================
Files 664 665 +1
Lines 23971 23977 +6
Branches 4315 4315
=======================================
+ Hits 19314 19321 +7
+ Misses 4591 4590 -1
Partials 66 66
Continue to review full report at Codecov.
|
<View style={styles.contentContainer}> | ||
<View style={{ ...styles.author, width: 60 }} /> | ||
<View style={styles.row}> | ||
<View style={{ flex: 1 }}> | ||
<View style={{ ...styles.title, flex: undefined, marginBottom: 4 }} /> | ||
<View style={{ ...styles.title, flex: undefined, width: '60%' }} /> | ||
</View> | ||
<View style={styles.image} /> | ||
</View> | ||
</View> |
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.
I broke our rule of not using inline styles here because I thought it made more sense to have them directly there.
But let me know if you think I should really not do this.
0c3b7dd
to
8d4dc8e
Compare
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.
LGTM!! any plans to submit the patch to the skeleton project? :D
Yes the patch was submitted already: chramos/react-native-skeleton-placeholder#71 |
Description
This replaces the loading spinner by a skeleton placeholder with a shimmering animation in the Celo news feed.
Why?
From https://blog.prototypr.io/skeleton-loader-an-overview-purpose-usage-and-design-173b5340d0e1
Next: use this in other screens where it makes sense (transaction list, dapp list, etc).
I had a look at several libraries to implement this and settled on https://github.com/chramos/react-native-skeleton-placeholder as it had the "best" implementation using a mask and linear gradient so the effect works across several isolated views, with an animation driven by the native driver.
In the future, I could see us fork the lib or include it in our components to further customize it to our needs.
Test plan
screencap-2022-12-21T135359.194Z-1080.mp4
Note: I added an artificial delay of 5 secs in the above video so we can see it better
Related issues
Backwards compatibility
Yes