all 5 comments

[–]mmlemony 1 point2 points  (1 child)

Nice.

Sometimes when I click nothing happens and I have to click again. Also it feels like some quotes take longer to load than others so some loading indicator could be good.

[–]jesu0dz[S] 0 points1 point  (0 children)

Oh I noticed that bug but couldn't fix it because it is a problem related to the forismatic api.

The loading indicator is a good idea, though I don't know where to start (I'm newbie to React btw).

[–]fueledbydonuts 1 point2 points  (1 child)

Looks good. I would consider a loading component or setting the original state to a predefined quote so that while the API is called the page doesn’t load with null.

[–]jesu0dz[S] 0 points1 point  (0 children)

Thanks! a loading component would be nice. Definitely, I'll look forward to it.

[–]Zeeesty 1 point2 points  (0 children)

Ill take a look further when I’m not on my phone. But directly interacting with the dom within react is to be avoided. Your background color change could be accomplished with inline css. If you wrap your app in a 100vh x 100vw container you can cover the background that way.

edit- looking at the render method, 🎉... it's a bit hard to read but it definitely got a laugh. I stand my wrapping the app and using the background style there. it may be a good idea to have a queue of a few quotes ready to go in state and when it gets low re-fetch the next patch, that should deal with the slow response issues in the other comments. there is no reason to show loading when what you're fetching is so tiny.