8000 Implemented redux state management by JunHammy · Pull Request #37 · MakanMatch/Frontend · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 8 commits into from
Jul 6, 2024
Merged

Implemented redux state management #37

merged 8 commits into from
Jul 6, 2024

Conversation

JunHammy
Copy link
Contributor
@JunHammy JunHammy commented Jul 5, 2024

Switched from using UserContext to authReducer.
Upon successful creation of JWTs, authStateData will store the userID, username and userType.

@JunHammy JunHammy requested a review from Prakhar896 July 5, 2024 08:44
Copy link
Contributor
@Prakhar896 Prakhar896 left a 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 = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use AuthState?

Copy link
Contributor Author

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.

dispatch(setLoading(false));
try {
const response = await server.get('/cdn/MyAccount', {
Copy link
Contributor

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.

Copy link
Contributor Author

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?

@JunHammy JunHammy requested a review from Prakhar896 July 5, 2024 09:57
Copy link
Contributor
@Prakhar896 Prakhar896 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Prakhar896 Prakhar896 merged commit 732c7ca into main Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants
0