-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
add skeleton when query is loading #5872
Conversation
SUCCESS @leo-anderson-x PR for issue #5749 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime! |
✅ Deploy Preview for koda-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
AI-Generated Summary: This pull request adds skeleton loading indicators for query results in the CollectionList and ItemsGrid components. The implementation includes the creation of CollectionCardSkeleton and NeoNftCardSkeleton components, as well as modifications to the CollectionList, ItemsGrid, and index files. |
nice! works for me 🚀 wdyt about removing hover on skeleton load? Does that make sense or nah? |
@exezbcz good idea, updated |
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.
Coule you please use NeoSkeleton component instead of b-skeleton ?
@roiLeo updated |
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.
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.
Pointed out by @roiLeo and @Jarsen136
@roiLeo updated to: if screen width < 1024 (at this point 4 is enough), show 4, else show 12 collections and 14 items. |
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 find it more readable to put skeleton near <DynamicGrid />
component, so you'll have all 3 options in the same file (data, loading skeleton & empty data)
Did you try to put it on that level?
@roiLeo u means the following three options in parallel, right? <DynamicGrid v-if="total !== 0">...</DynamicGrid>
<template v-else-if="isLoading">
<CollectionCard v-for="n in SKELETON_COUNT" :key="n" is-loading />
</template>
<EmptyResult v-else /> But the skeletons also needs to be wrapped in a DynamicGrid to get the same size as a normal Card (it is dynamically derived from the screen size). So if we place three options in parallel, the result will look like this: <DynamicGrid v-if="total !== 0">...</DynamicGrid>
<DynamicGrid v-else-if="isLoading" {...same props as above}>
<CollectionCard v-for="n in SKELETON_COUNT" :key="n" is-loading />
</DynamicGrid>
<EmptyResult v-else /> This seemed a bit repetitive, so I chose to put the skeletons inside the first |
Yes I find something like that easier to maintain
Hmmmm... not sure I'm following you're idea, more like: <DynamicGrid v-if="!isLoading && total">...</DynamicGrid>
<template v-if="isLoading">
<!-- use same limit as query -->
<div v-for="index in limit" :key="index">
<div class="collection-card card">
(Here you manage to recreate simple card using same class with skeleton components)
</div>
</div>
</template>
<EmptyResult v-if="total === 0 && !isLoading" /> |
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.
✅ works for me anyway
Please resolve conflicts + |
# Conflicts: # components/items/ItemsGrid/ItemsGrid.vue # libs/ui/src/components/NeoNftCard/NeoNftCard.vue
will check again when it's ready |
@prury should be ready |
Code Climate has analyzed commit 97118dc and detected 0 issues on this pull request. View more on Code Climate. |
Its showing 40 skeletons for both collections and items for me, if that is intended, works well, had to use a bandwidth limiter to test it.
|
pay 30 usd |
😍 Perfect, I’ve sent the payout 🪅 Let’s grab another issue and get rewarded! |
@prury Yes, it's intended. We use same size as fetched data |
Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.
👇 __ Let's make a quick check before the contribution.
PR Type
Context
Had issue bounty label?
Screenshot 📸
CleanShot.2023-05-06.at.20.55.03.mp4
Copilot Summary
🤖 Generated by Copilot at 93ba4fe
This pull request adds loading states for the collection list and items grid components, using skeleton components to show placeholders while the data is loading. It also adds two new skeleton components,
CollectionCardSkeleton.vue
andNeoNftCardSkeleton.vue
, to the@kodadot1/brick
library, and exports them for reuse.🤖 Generated by Copilot at 93ba4fe