-
Notifications
You must be signed in to change notification settings - Fork 0
Implemented redux state management #37
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
Conversation
Sync-up PR (Jun Han)
Sync-up PR (Jun Han)
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.
See comments
|
||
function Navbar() { | ||
const { isOpen, onOpen, onClose } = useDisclosure() | ||
const navigate = useNavigate(); | ||
|
||
const handleAvatarClick = () => { |
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.
Why not use AuthState
?
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 have made the changes to Sidebar.jsx also.
src/slices/AuthState.js
Outdated
dispatch(setLoading(false)); | ||
try { | ||
const response = await server.get('/cdn/MyAccount', { |
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.
Consider changing endpoint to camel case.
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've changed this one on frontend, do i need to go main branch to change for backend?
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.
LGTM
Switched from using UserContext to authReducer.
Upon successful creation of JWTs,
authStateData
will store theuserID
,username
anduserType
.