Simple ReactJS build of the Subreddit Points component.
Check out the live demo on Heroku.
- Change the API call to leverage some form of the Render Props pattern. This way, we can do the following:
- Load the card lazily (on-demand) as the user scrolls it into view.
- Depending on the desired UX, show some indication that the card is loading/retrieving data (e.g., a loading spinner).
- Show feedback if there is an error with retrieving or displaying the data.
- Create a single
Section.js
component that abstracts the differences between theSubredditValueSection.js
andDonutsSection.js
components. - Clean up the components' inline Emotion styling. It was convenient for rapid-prototyping, but it ruins the "at-a-glance" of the HTML/JSX structure when there's too much.
- Abstract copy/content away from components, and centralize them. Possibly add localization.