-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit profile #140
base: main
Are you sure you want to change the base?
Edit profile #140
Conversation
(Once again, do we really need those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work! 🎉
Added a few comments regarding Auth and deadly package-lock.json. XD
const [accessToken, setAccessToken] = useState( | ||
localStorage.getItem("access_token") | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of getting accessToken here, you can directly use the AuthContext
to get access token as well as a user (if you want) back from it. See:
SocioMark/frontend/src/Components/UserFeed.js
Lines 16 to 17 in 6c8857b
const { token } = useContext(AuthContext); | |
const [access] = token; |
And this:
<AuthContext.Provider value={{ user: [user], token: [access] }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing localStorage.getItem
at multiple places might be concerning as if we ever wanted to change the key name, we'd have to do it at multiple places.
@@ -4,6 +4,7 @@ | |||
"private": true, | |||
"dependencies": { | |||
"@craco/craco": "^6.1.1", | |||
"@headlessui/react": "^1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we're adding it as a dependency, but the changes in package-lock.json are tooo huge to be just one package's addition? Or is that the case? :/
Allows user to edit their name or description. Does not allow user to edit email.
Resolves #84
Screenshot: