Skip to content
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

Backend context and reducer #4

Open
wants to merge 5 commits into
base: Main
Choose a base branch
from

Conversation

MayankKumar10
Copy link
Owner

Adding Backend context and reducer

Copy link

@foolhardy21 foolhardy21 left a comment

Choose a reason for hiding this comment

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

code looks good. Just the ContextProducts.jsx looks confusing as it has reducer too unlike other context files and ReducerProducts.jsx does not have reducer in it. You can remove console.logs if not needed.

@@ -0,0 +1,67 @@
import React, {

Choose a reason for hiding this comment

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

suggestion - you can name this file similar to how you have named other context files so that naming looks consistent.

Copy link

@ShekharDhangar ShekharDhangar left a comment

Choose a reason for hiding this comment

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

Try the suggested changes, rest looks good


const FilterReducer = (
state,
{ type, payload }

Choose a reason for hiding this comment

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

liked that you destructuring in parameters

Comment on lines +2 to +13
var modal =
document.getElementById("myModal");

// Get the button that opens the modal
var btn = document.getElementById("myBtn");

// Get the <span> element that closes the modal
var span =
document.getElementsByClassName(
"close"
)[0];

Choose a reason for hiding this comment

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

you can instead build a custom hook like useCloseModal and use "useref" instead of doing vanilla js. this it will be much more useable.

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.

3 participants