Skip to content

mohamed-benoughidene/Advice-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Advice generator app solution

This is a solution to the Advice generator app challenge on Frontend Mentor.

Table of contents

Overview

The challenge is to build out this advice generator app using the Advice Slip API and get it looking as close to the design as possible.

The challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Generate a new piece of advice by clicking the dice icon

Screenshot

Links

Built with

  • React
  • axios
  • Scss
  • Flexbox
  • Mobile-first workflow and Desktop-first workflow (a mix)

What I learned

I Learned to use axios this is my first time using it.

const [quote, setQuote] = useState([]);
const axios = require('axios');
    axios.get(`https://api.adviceslip.com/advice/${x}`)
        .then(function (response) {
            setQuote(response.data.slip.advice);
            setQuoteId(response.data.slip.id);
        })
        .catch(function (error) {
            console.log(error);
        })

Author

About

This is a solution to the Advice generator app challenge on Frontend Mentor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors