React | SCSS | shrtcode API | SessionStorage | Clipboard API
Design comparison
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
- @mickygingerPosted over 3 years ago
Hey @tkulic this is great!
I would recommend setting a
max-width
on the main containingdiv
element inApp.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
orsection
rather than adiv
as the main containing element, as it's more semantic.Your components are nicely organised. You can name any file
index.js
orindex.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@tkulicPosted over 3 years agoThanks, @mickyginger, for reviewing my code and writing out all these suggestions!
- 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. - I solved the
div
issue with React Fragment. The components were already semantically structured, but the wrappingdiv
was ruining the whole thing, as you noticed. I simply removed it. The "root" div is still there though, due to React's nature. - 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.
- 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 - I played around a bit with
Please log in to post a comment
Log in with GitHubJoin 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