Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Responsive website using React and styled-components

react, styled-components, react-router
Astrix1234•200
@Astrix1234
A solution to the Designo multi-page website challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am most proud of successfully creating a responsive and visually appealing website that adapts well to various screen sizes using React and styled-components. The integration of interactive maps with Leaflet JS on the locations page was a challenging yet rewarding experience, enhancing the user experience.

If I were to do this project again, I would focus more on optimizing performance from the start. While lazy loading and code splitting were implemented, additional techniques such as server-side rendering (SSR) with Next.js could further improve the initial load times. Additionally, instead of using styled-components, I would opt for Tailwind CSS when working with Next.js for a more seamless integration and improved styling performance. I would also refine the form validation logic to provide even more user-friendly error messages and consider integrating a backend service for dynamic data fetching to make the site more scalable and maintainable.

What challenges did you encounter, and how did you overcome them?

One of the main challenges I encountered was managing responsive design across different screen sizes. Ensuring that the layout and interactive elements looked good and functioned well on both mobile and desktop devices required careful planning and testing. I overcame this by using CSS grid and flexbox for layout management, and media queries to adjust styles based on the screen size.

Another challenge was integrating interactive maps with Leaflet JS, especially ensuring that they loaded correctly and were fully responsive. To solve this, I leveraged my prior knowledge of Leaflet JS, revisited the documentation, and experimented with different configurations until I achieved the desired result.

Additionally, form validation was a significant challenge. Implementing comprehensive and user-friendly validation required utilizing Formik and Yup. I overcame this by drawing on my previous experience with these libraries, thoroughly revisiting their documentation, and testing various validation scenarios to ensure all edge cases were covered.

Lastly, optimizing performance with lazy loading and code splitting required a good understanding of React's lazy and Suspense features. I resolved this by applying my existing knowledge of these features, gradually implementing them, and testing their impact on the application's load time, ensuring that the user experience remained smooth.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Astrix1234's solution.

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.