Design comparison
Solution retrospective
Proud of:
-
Component Structure: I'm proud of the clear and modular component structure of the project. Separating the Card component from the App component makes the code more readable and maintainable.
-
Styling: The use of Tailwind CSS for styling ensures a clean and modern design with minimal effort. The use of CSS classes like bg-cover, bg-center, and shadow-retro enhances the visual appeal.
-
Data Handling: Mapping over the learningCards array to dynamically generate Card components is an efficient way to handle multiple data entries.
Do Differently:
-
Error Handling: Add error handling for missing data, such as a default image if the cover URL is not found or a placeholder if the authorPhoto is missing.
-
Prop Types: Implement PropTypes for type checking, which can help catch bugs related to incorrect prop types.
-
Component Testing: Write unit tests for the components to ensure they render correctly with different props.
Challenges:
Dynamic Background Image in Inline Style:
- Solution: Used template literals to dynamically set the background image in the Card component's div. This required understanding of how to properly format the URL string within the style attribute.
Responsive Design:
- Solution: Utilized Tailwind CSS's responsive design utilities, such as sm:w-[320px], to ensure the card adjusts to different screen sizes. This involved learning and applying Tailwind's responsive classes effectively.
Date Formatting:
- Solution: Created a helper function monthFormat to convert the month number to its abbreviation. This required basic understanding of JavaScript functions and array indexing.
Optimizing Performance: Any suggestions on optimizing the rendering performance of the Card components, especially if the learningCards array grows significantly.
Accessibility: Best practices to improve the accessibility of the components for users with disabilities.
Advanced Styling Techniques: Advice on advanced CSS or Tailwind techniques to enhance the visual design and interactivity of the cards.
State Management: Recommendations on how to handle state management if the app scales, particularly if more dynamic interactions are introduced.
Testing: Guidance on setting up a testing environment and writing effective tests for React components using libraries like Jest and React Testing Library.
Community feedback
- @RevazSologhashviliPosted 6 months ago
Great work!
The only thing I would change in your solution is to create a 'cardData.ts' file for storing every card item's information and then import it for use wherever I need it. Other than that, everything looks well done to me.
1
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