This is a solution to the Advice generator app challenge on Frontend Mentor.
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.
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
- Solution URL: solution URL
- Live Site URL: live site
- React
- axios
- Scss
- Flexbox
- Mobile-first workflow and Desktop-first workflow (a mix)
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);
})
- Frontend Mentor - @mohamed-benoughidene
