Eventually only store token in local storage, use it to decipher userId, and finally get user object from database by id and set it in useState() to be used by all aspects of the website. For now, build out this functionality and make sure it works before moving forward.
Get rid of the userID stored in local storage. Find out what relies on it, refactor the code, and make sure the code that relies upon it doesn't break.
Ticket 3:
Remove all localStorage.getItem() calls and localStorage.removeItem() calls except for those dealing with tokens.
Ticket 4:
Clean up the code to refactor and remove old code smell due to legacy code design that was meant to facilitate the former localStorage items and is still designed that way but used for the user object now. Clean up: props, comments, useStates(), Link import in Profile.js. Pass user instead of isAdmin and refactor code accordingly to include user.isadmin. Change cItems to something more descriptive and make it a boolean that goes from false to true to false, etc.
Ticket 5:
Change the columns in the user rows in the database to be more flexible and better facilitate grabbing this information from the user object to fill out the order if the user checks a box that says use personal address on file. The changes may require userlocation in the database to be broken into usercity, userstate, and userzip.
Ticket 6:
Add an Order component and call that Order.js when you click the order button to navigate the user there to that page to fill out the order request
When the order is placed, notify the user the order is placed and that they are being redirected away from the order page back to their profile where they may see their new order
This is going to require the following:
Ticket 1:
Ticket 2:
Ticket 3:
Ticket 4:
Ticket 5:
Ticket 6: