Skip to content
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(collection): status signaling #724

Merged
merged 18 commits into from
Sep 15, 2021

Conversation

roiLeo
Copy link
Contributor

@roiLeo roiLeo commented Sep 13, 2021

Tested on:

  • /rmrk/collection/800f8a914281765a7d-KITTY
  • /rmrk/collection/466e8b6338599eaf1e-GAVS371
  • /rmrk/collection/900D19DC7D3C444E4C-KSMG22

PR type

  • Feature

Before submitting this PR, please make sure:

  • Code builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've didn't break any original functionality
  • I've posted screenshot of demonstrated change in this PR

Optional

  • I've tested it on mobile and everything works
  • I found edge cases:
  1. When collection doesn't have floor price
  2. When there is multiple "BUY" events on one single NFT

What's new? (may be part of changelog)

Screenshot

Screenshot 2021-09-13 at 11-58-58 Kitty Paradise
Screenshot 2021-09-13 at 11-59-38 GAV Sphere - Generative AudioVisual Collection

Notes

In this PR i've edited some typescript file to fix building errors/warnings and I don't know if it break something.
24h volume traded feels weird :/

Copy link
Member

@vikiival vikiival left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work.

I would just move view to the separated .vue file along with the getters 👁️

Also I would move filtering to the graphql
https://doc.subquery.network/de/create/graphql/#json-type

src/components/rmrk/Gallery/CollectionItem.vue Outdated Show resolved Hide resolved
src/components/rmrk/Gallery/CollectionItem.vue Outdated Show resolved Hide resolved
src/components/rmrk/Gallery/CollectionItem.vue Outdated Show resolved Hide resolved

get collectionTradedVol() {
return this.nfts
.map(nft => nft.events.filter((e: { interaction: string; }) => e.interaction === 'BUY'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this piece of code reusable

@roiLeo
Copy link
Contributor Author

roiLeo commented Sep 13, 2021

Should I create a new component (CollectionActivity) with "collection.nft" as prop ? or move code into GalleryCardList ?
Do I have to create 2 graphql query ? (one for Traded NFT and one for Traded Volume) or I need something else ?
I'm a bit confused with this, are we going to perform a new API call instead of filtering current data ?

@vikiival
Copy link
Member

vikiival commented Sep 14, 2021

Should I create a new component (CollectionActivity) with "collection.nft" as prop

Yes please :)

Edit:
Filtering is not possible on GraphQL since it would return less data

@yangwao
Copy link
Member

yangwao commented Sep 14, 2021

All good, only 24h volume traded is missing, should we wait for the next commit or will for another PR? @roiLeo 👀😄

@roiLeo
Copy link
Contributor Author

roiLeo commented Sep 14, 2021

Tested on Kitty
while code feel ugly

I need more test case

Screenshot

Screenshot 2021-09-14 at 16-44-20 Kitty Paradise

@yangwao
Copy link
Member

yangwao commented Sep 15, 2021

Tested on Kitty
while code feel ugly

I need more test case

I guess, let's push it and we will see how it goes? :)

I guess we will receive some feedback as well.

@yangwao yangwao merged commit 847acf6 into kodadot:main Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Status signaling for collections
3 participants