Design comparison
Solution retrospective
Please provide some feedback.. :)
Community feedback
- @melwyntPosted over 2 years ago
Hi there!
Good job on the design.
For the quotes, you might want to use those symbols instead to respect the design: Reversed Double Prime Quotation Mark
The dice button is not working. I also used React for this project. Please feel free to check my solution here.
I think you are facing the same issue that I had.
Fetch
(orAxios
) is caching the data. Because of this it will always return the same value. To overcome this, the URL needs to be always different. This can be done by inserting a timestamp in the url. Here's an example withAxios
:const getData = async () => { const url = 'https://api.adviceslip.com/advice'; const data = await axios.get(`${url}?timestamp=${new Date().getTime()}`); setAdvice(data.data.slip); };
All the best!
Marked as helpful0@Adhi-S12Posted over 2 years ago@melwynt Hello, Thanks for the input, I was planning to add Reversed Double Prime Quotation Mark but forgot to add it at the end. I just checked now, the dice button is working. In the Api docs it is mentioned that Advice response is cached for 2 seconds. Any repeat-request within 2 seconds will return the same piece of advice. Thanks for the timestamp tip, I'll try it in the project.
0 - @shashreesamuelPosted over 2 years ago
Hey, good job completing this challenge, keep up the good work
Your solution looks great however I think the green dice needs some margin from top using
margin-top
I hope this helps
Cheers Happy coding š
Marked as helpful0@Adhi-S12Posted over 2 years ago@TheCoderGuru Yes the margin needs to be updated, thanks for the response
0
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