Create UserContext
Closed this issue · 8 comments
Integrate an extra context, named UserContext, into the application.
This context should have two states and their respective setState functions:
- user: Initialize as null
- token: Set to either null or a token, retrieved from
localStorage.getItem("token")
Implement a useEffect hook within the UserContext that:
- Triggers when the token state changes
- If a token is now present, console.log "fetching user" (actual user fetch functionality will be added later)
Ensure the following are exported:
- UserContextProvider
- useUserContext custom hook function
In the App.js file, enclose components with the newly added context. You can reference the other contexts defined as it will closely resemble them.
Hey, I would be willing to work on this
Assigned @ijklmopffs ! Feel free to reach out for anything
Hello, can we connect on discord or telegram?
Hello, can we connect on discord or telegram?
Yes, you can ping me on our discord server, I am under Mireles#1596
hi @ijklmopffs , can we get a status update on this?
i will remove the assignment from this issue since we have yet to get a response from the potential contributor. If anyone would like to get assigned, feel free to comment below.
hey @lugenx , I'll add this up.
Awesome! Assigned. Thank you! 👍