-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
NFTs page #7144
NFTs page #7144
Conversation
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.
Brilliant, this has been outstanding for a very, very long time.
Closes #5397
Will give it a run-through.
Hi @jacogr, I've moved the ipfs related logic into a separate hook and now the tests started to fail because of that import: |
The reason the tests are failing is because it uses |
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 looks really good. Some s/-assets/-nfts/
comments and then some future work comments. But it really looks spot-on.
|
||
function Item ({ className, collectionName, value: { account, id, ipfsData } }: Props): React.ReactElement<Props> { | ||
const name = ipfsData?.name || collectionName; | ||
const imageLink = ipfsData?.image ? `https://ipfs.io/ipfs/${ipfsData.image}` : ''; |
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 think this is fine for now, however have has issues in the past where we blew past the ipfs.io limit - so I guess it would make sense to add something where we iterate through different IPFS gateways in the future. (As a follow-up). Something like useIpfsLink(hash)
and then it randomly selects one from a list of known gateways and returns it.
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.
That gateway is extremely slow, if we decide to display the images on that page - it would be better to create a simple proxy/CDN service to cache them. And yes, we would need to make that gateway's URL configurable
Any ideas on how to solve this? I tried to add this polyfill to
|
Doing this in that test or specific hook should solve it - import '@polkadot/x-textencoder/shim'; It just exposes the global if not available. |
Yay, you've saved my day! |
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.
Thank you!
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
A new page where we could see all the NFT collections exist as well as collections + items that the connected account has.
NFTs page:
My NFTs: