Design comparison
Solution retrospective
I'm proud of implementing a valuable advice to use kind of subcomponents, that are specific to the component. Next time I'd wrote more useful readme.md
What challenges did you encounter, and how did you overcome them?I submitted this challenge a while ago.
And it took me some time to recover pre-commit linting with lefthook, so I had to switch from yarn to npm.
Because yarn created .pnp. files (also typescript vscode integration), while I do not agree to tolerate anything more than package.lock
How to achieve pixel-perfect layout from .jpg design file?
When I use 1px x 1px grid with max zoom in the browser .jpg edges kinda blurry and I each position I try is wrong ='(
Community feedback
- @RazaAbbas62Posted 10 months ago
For a small card with straightforward child elements, keeping them within the Card component is likely more practical. This maintains simplicity, readability, and facilitates easier maintenance. Separate components might be overcomplicating for such a scenario.
Marked as helpful1@ha308ingPosted 10 months ago@FazeenIjaz thank you for the feedback! Are there scenarios when such overcomplication makes sense?
0@RazaAbbas62Posted 10 months ago@ha308ing Creating separate React components for each child element in the card can be reasonable for improved modularity, reusability, and maintainability, especially when components involve complex logic or need to be reused across different parts of the application. However, it's crucial to strike a balance and avoid overcomplicating the structure for simpler UIs.
Marked as helpful1 - @EChilin5Posted 10 months ago
In my opinion, I don't think you have to break it down to that level but I understand what you are trying to do. It might be an overcomplication. It's something I am trying to decide on my own as well.
Below is a card link from react-bootstrap that might provide a good example of how they made their card design and another way to solve this challenge.
In my opinion, I prefer their example because it'll be easier to pass information to their card instead of passing information to each component of the card. It might be unnecessary props if you have several components inside the card component. I'm still learning and trying to get better. Hopefully, this helps with your question, and best of luck.
Marked as helpful1 - @Naveen-CBPosted 10 months ago
Hello @ha308ing, mostly this types of card layout are just used as news, article, aside or blog in a website so nothing wrong to creating a appropriate tag for each data but it is some level of overcomplication for small part in a web(actually not needed that much) .
I hope it helpful for you❤️.
Happy learning🚀.
Marked as helpful1
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