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

Style NFT detail page #155

Merged
merged 24 commits into from Jun 28, 2022
Merged

Style NFT detail page #155

merged 24 commits into from Jun 28, 2022

Conversation

benborgers
Copy link
Collaborator

This styles the NFT detail page (/nft/[address]) page with a developer-y table of attributes and their values.

Solana addresses are copyable, and links are clickable. Traits (if present) are listed under a separate table.

Examples:

@benborgers benborgers requested a review from vpontis June 28, 2022 16:49
@vercel
Copy link

vercel bot commented Jun 28, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nftoken ✅ Ready (Inspect) Visit Preview Jun 28, 2022 at 5:56PM (UTC)

@benborgers benborgers changed the title NFT detail page Style NFT detail page Jun 28, 2022
@benborgers
Copy link
Collaborator Author

@vpontis Just curious, why did you choose to load the data both in getServerSideProps and on the client side with SWR? I can follow the same data loading approach with the collection page.

@vpontis
Copy link
Collaborator

vpontis commented Jun 28, 2022

@vpontis Just curious, why did you choose to load the data both in getServerSideProps and on the client side with SWR? I can follow the same data loading approach with the collection page.

  • getServerSideProps — This allow us to have initial data when the page loads. That means there is no loading state and search engines can pick up our page.
  • swr — We want to refresh data automatically if you switch between tabs.

Copy link
Collaborator

@vpontis vpontis left a comment

Choose a reason for hiding this comment

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

Sweet!

  1. Let's be smarter about having an empty state if there are no traits
  2. Let's update Collection to link to the collection page if a collection is set. We can also make another request to get rich collection info and have that as a separate section (similar to how Traits is a separate section)

docs/package.json Outdated Show resolved Hide resolved
docs/pages/nft/[nftAddress].tsx Outdated Show resolved Hide resolved
Co-authored-by: Victor Pontis <victor@pont.is>
@benborgers
Copy link
Collaborator Author

I’ve added a button that leads to the collection page but commented it out for now since the collection page doesn’t exist yet. Having another two levels of data (nft.collection attributes and maybe nft.collection.traits) on the NFT page felt like it would make the page too complex, so I’ll have a similar table of attributes/traits on the collection page a click away.

@benborgers benborgers merged commit 66bff88 into master Jun 28, 2022
@benborgers benborgers deleted the l-5177-create-nft-detail-page branch June 28, 2022 18:02
vpontis added a commit that referenced this pull request Jun 28, 2022
@benborgers benborgers mentioned this pull request Jun 28, 2022
27 tasks
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.

None yet

2 participants