nobt-io / frontend

Frontend of nobt.io.
https://nobt.io
GNU General Public License v3.0
10 stars 4 forks source link

Create dedicated NobtLoader component #59

Closed thomaseizinger closed 7 years ago

thomaseizinger commented 7 years ago

We move all the logic of rendering and tracking the fetchStatus of the nobt to the NobtLoader itself. This allows us to generically display the progress bar and switch to the underlying component as soon as the nobt finished loading.

Before After
https://i.gyazo.com/943783b1fbfac3c29656bbc33553b68c.mp4 https://i.gyazo.com/2ef39b01bb20562fa0007af5422cbb23.mp4

Initially, this might look like a step backwards (because we loose the app bar). However, with the new structure, the loading screen ALWAYS appears, no matter on which page you are one. Previously, the loading indicator was embedded in the main page. With the new NobtLoader component, we can style this loading page individually and child components no longer have to deal with the status of the fetch operation on their own because they are not rendered until the fetch was successful.

If desired, we can re-add the AppBar at any time. However, the styling is currently applied locally and I first wanted to make the feature change before figuring out a solution that allows to display the AppBar with the same styling without duplication.