lugenx / ecohabit

EcoHabit is a web app project that aims to create awareness of the environment and help people build environmental friendly habits.
http://www.ecohabit.org
GNU General Public License v3.0
91 stars 71 forks source link

Use Token from UserContext in Homepage Component #248

Closed lugenx closed 1 year ago

lugenx commented 1 year ago

Refactor the Homepage component to get the user token from UserContext instead of directly from localStorage.

Steps:

  1. Replace localStorage.getItem("token") with the token from useUserContext.

    Remove:

    const token = localStorage.getItem("token");

    Update importing userContext to look like this:

    const { user, setUser, token } = useUserContext();
  2. Ensure the app's functionality remains unchanged.


:warning: Before you start working on this issue, please comment below expressing your interest, and wait to be assigned. :warning:

Devrishi-Dutta commented 1 year ago

I want to do my first contribution, can you assign me this issue?

lugenx commented 1 year ago

assigned, thank you @Devrishi-Dutta . Let me know if you have any question.

Devrishi-Dutta commented 1 year ago

Am I supposed to do anything else after making the pull request? (in this issue )