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

Responsive Advice Generator

#react
Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


  1. It took me a while to figure out how I was going to fetch the API as it's done a variety of ways, but once I got that sorted my priority was the CSS, especially the responsive design.

  2. The code in the return statement looks quite messy, does anyone have a cleaner way to organise the code?

  3. What's best practice when fetching data from an API as well as media queries for responsive design?

Community feedback

imad 3,310

@imadbg01

Posted

Greeting Jay-Ann Bravo-Harriott!! Congratulations for completing your challenge!, 👏👏👏.

You did great on this challenge, but there is a bug on Firefox relative to cache, Firefox users will not be able to generate a new advice, to fix that for them simply pass an optional parameter {cache: 'no-cache'} to fetch.

 const getAdvice = () => {
    const url = "https://api.adviceslip.com/advice";

    fetch(url, {cache: 'no-cache'})

// ...

Overall, good job, have a great day/night, and keep coding 👍.

1

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