tusmanakhter / MigrantHub

MIT License
4 stars 3 forks source link

Refactored layout #147

Closed tusmanakhter closed 5 years ago

tusmanakhter commented 5 years ago

App now using one layout for all protected routes and one for all unprotected routes. It makes it seem like I modified lots of code but I mainly removed and wrappers from all classes.

Sidebar and header links are generated based on which type of user is logged in.

App now uses AuthContext using React Context to share authentication information with all components. This reduces code duplication since we do not need to define getUser methods in each component. It also separates all logic to get and retrieve user state in one class. I also switched to using cookies instead of local storage.