Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

React | SCSS | shrtcode API | SessionStorage | Clipboard API

@tkulic

Desktop design screenshot for the URL shortening API landing page coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello everyone!

This is the first challenge I took up on Frontend Mentor. I completed it in a few steps. First, I took enough time to plan out HTML structure and CSS classes based on design files. Then, I created well-structured content as React components with JSX and styled them afterwards with SCSS. Implementing main functionality was a bit bumpy, but i managed to do it with help of Clipboard API and Session storage. Hope someone finds this short description helpful....

I appreciate Your feedback! Cheers!

Community feedback

T
Mike Hayden 1,005

@mickyginger

Posted

Hey @tkulic this is great!

I would recommend setting a max-width on the main containing div element in App.js so that the content doesn't fill the entire width of the screen, something like 1200px is reasonable.

I would also consider using a main or section rather than a div as the main containing element, as it's more semantic.

Your components are nicely organised. You can name any file index.js or index.jsx and import it using the name of the folder, so for example:

import Main from './components/Main' would work fine if the component was located in ./components/Main/index.jsx.

Finally I notice that you used a mixture of double quotes " and single quotes ' in your JavaScript. It's probably worth using a formatter like Prettier that will format your code for you.

Great first project, well done! 🎉

1

@tkulic

Posted

Thanks, @mickyginger, for reviewing my code and writing out all these suggestions!

  1. I played around a bit with max-width and eventually set it to 1200px. It was a major improvement for such a bit of work.
  2. I solved the div issue with React Fragment. The components were already semantically structured, but the wrapping div was ruining the whole thing, as you noticed. I simply removed it. The "root" div is still there though, due to React's nature.
  3. I decided not to rename components for this project, but i will definitely consider this naming convention in the future. Indeed, it does make it clear which file is the most important one in a folder.
  4. And the quotes thing, yeah... I prefer using double quotes, without a particular reason. The single quotes are stemming from a React plugin I have installed. And Prettier does not support converting everything into double quotes. So I'm a bit stuck. I haven't made up my mind yet what will I do, so I left it as it is for now 😅.

I hope to read from you on my upcoming project uploads!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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