Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

NFT Preview Card with React

react, react-testing-library
Rio Cantre•9,650
@RioCantre
A solution to the NFT preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


As the second project, I challenge myself to put a bit of effort in making this one. I used React and made progress in making the components. This is the first project I made with react with no step by step guide. I learned from the previous projects that I made about making individual components and applied it on the main file structure. I used plain CSS for styling and semantic HTML for the structures of every component. I divided the parts in 4 sections, so that it would be easier to debug. It is a tiny project and making this one enhances my skills on creating Apps with React.

Any feedback would be appreciated. Have a nice one! Cheers!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raymart Pamplona•16,040
    @pikapikamart
    Posted over 3 years ago

    Hey, really nice work on this one and congrats on your second project here at FEM!. The overall layout of the site I think looks great. Just an issue about it is that, when you zoom out, the bluish background of the nft container just fills up the whole width of the screen, you might want to check that one out.

    But for some other suggestions, here are some:

    • For this one, it would be really nice to use main and footer. Change the .App to using main and the .attribution to use footer tag so that both will be contained inside of a landmark element.
    • The header on this one is used wrong sorry. A secondary header or just header as sectioning should be used not by itself only. For example, you could use article where there is a header but not on this one. You can just replace it with a div and it would be fine.
    • Since there is a :hover state on the image, meaning that it is interactive, then there should be an interactive element present as well and not only the img tag. When you create a component that could be interacted with user, always remember to include interactive elements like button or a tag. For this one, since when hovering on it, there appears a preview-icon, imagine what will happen if the user clicks the image. If clicking the image would just show a pop-up where the user can see the full nft, then go with button, but if by clicking it redirects the user in another page to see the nft, then go with a tag. Both could be wrapping the img but I would prefer to just place it beside it. I haven't tackled this one out yet so I can't give a reference on this one:>
    • For the nft image, you can use the nft name as the alt since it is already present like alt="nft Equilibrium #3429". I know that the value is somewhat still ambiguous because it doesn't really represent the nft looks. But since nft is to be seen, I would prefer to still add the alt.
    • The img for the preview-icon is only decorative. Decorative images should be hidden for screen-reader at all times by using alt="" and aria-hidden="true" to the img tag or only aria-hidden="true" if you are using svg instead of img tag.
    • For this one, you could use the nft name as the h1 since a single h1 is needed for a page of a site. Wrap the a tag within the h1:
    <h1>
      <a href=""></a>
    </h1>
    
    • When using img tag, you don't need to add words that relates to "graphic" such as "icon" and others, since img is already an image so no need to describe it as one.
    • The person's image could be using the person's name as the alt value since it is already present like alt="Jules Wyvern".
    • Same for the person's name, it is being treated as an interactive one so maybe wrapping the person's name within an a tag would be really nice.
    • Lastly, just addressing the issue when zooming out:>

    Again, great job on this one.

    Marked as helpful
  • Dev Rathore•2,540
    @GitHub-dev12345
    Posted over 3 years ago

    Hey Dude can you tell me how to make your simple portfolio website & which framework used for our portfolio, tell me and which site to deploy your portfolio

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub