Admin and Loading newbranch branch - Lucinas-Lasers/Grace-shopper GitHub Wiki

For the single record, single record player, all records, and all record players component have been edited to include a loading and admin feature. For the admin feature, I mapped to state the user, and if the user exists, and user.admin is true, the page will load a admin version of all records and all record players with an edit button and delete button. If the user exists and the user.admin is true, the single record player and the single record page will load with an edit button that is toggled off, and when clicked, it will load a form to edit certain things about the product.

In order to implement the loading feature, I changed all of the states for the redux components to objects instead of an empty array. The object contains a loading:true as default. When a thunk is dispatched, the reducer will add information to the state and change the loading to false and render the page with all the components loaded.