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

stateManagement using react context api #132

Closed
wants to merge 4 commits into from

Conversation

Justinnn07
Copy link
Collaborator

@Justinnn07 Justinnn07 commented Jun 1, 2021

🚨 Please review the guidelines for contributing to this repository.

Please check if the PR fulfills these requirements

  • Make sure you are requesting to NEW-UI. Don't request other protected Branches like staging/master
  • Make sure no conflicts are present in the code, if so please resolve it(Tip: Always fetch upstream)
  • Your Commit messages should make sense.
  • Don't push your package.lock.json as this project uses yarn.lock already.
  • Check your code additions will fail neither code linting checks nor unit test.

Describe your changes

  • Bought State management(React context API ) to the app ..

  • We can now access the req. data on any component!

❤️ Thank you!

@Justinnn07 Justinnn07 self-assigned this Jun 1, 2021
@vercel
Copy link

vercel bot commented Jun 1, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/stephin007/cowin-vaccine-availablity-checker/B9RRXhquuYjG7dMBk6YQT7kLkGnk
✅ Preview: https://cowin-vaccine-git-justinnn07-statemanagement-ste-aec722.vercel.app

@Justinnn07
Copy link
Collaborator Author

@stephin007 pls review and merge!

@stephin007 stephin007 linked an issue Jun 1, 2021 that may be closed by this pull request
import { GlobalStyles } from "./components/globalStyles";
import { useDarkMode } from "./Themes/useDarkMode";
import { lightTheme, darkTheme } from "./Themes/themes";
import { GlobalStyles } from "./Themes/globalStyles";
Copy link
Owner

Choose a reason for hiding this comment

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

@Justinnn07 why the name of the folder was changed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Justinnn07 why the name of the folder was changed?

Themes are not under components right ? so, thought of making a folder for themes

},
dispatch,
] = useDataLayerValue();

const [pin, setPin] = useState("");
const [formattedDate, setFormattedDate] = useState("");
const [selectedDate, setSelectedDate] = useState(new Date());
Copy link
Owner

Choose a reason for hiding this comment

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

@Justinnn07 why are the above states not used under context?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These states most prob. won't be used outside these components , so thought of maintaining as it is!

Well, if you want i can specify them under context

@@ -1,17 +1,15 @@
import React from "react";
import "./Pagination.css";
import ChevronLeftIcon from "@material-ui/icons/ChevronLeft";
import ChevronRightIcon from "@material-ui/icons/ChevronRight";

Copy link
Owner

Choose a reason for hiding this comment

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

these icons are not needed? @Justinnn07

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am making the UI of the pagination little attractive .. moreover, the prev button was not working tooo!

@stephin007
Copy link
Owner

@Justinnn07 Can you also add the api calls to state? i mean right now we are adding only the states!

@stephin007
Copy link
Owner

@Justinnn07 Also Please fill the PR Template!

@Justinnn07
Copy link
Collaborator Author

@Justinnn07 Can you also add the api calls to state? i mean right now we are adding only the states!

Is it necessary ? I am adding every api response to the reducer

@Justinnn07
Copy link
Collaborator Author

@Justinnn07 Also Please fill the PR Template!

sure!

@stephin007
Copy link
Owner

Is it necessary ? I am adding every api response to the reducer

State management means writing less code right? is this possible what i said?

@stephin007
Copy link
Owner

Also, @Justinnn07 are you removing pagination?

@Justinnn07
Copy link
Collaborator Author

Also, @Justinnn07 are you removing pagination?

Ohk :)

@Justinnn07
Copy link
Collaborator Author

Also, @Justinnn07 are you removing pagination?

No, I will be using Material-ui Pagination

@stephin007
Copy link
Owner

OKay @Justinnn07 it would be better if you raise another PR for pagination changes and use this PR solely for State Management!

please do the necessary

@Justinnn07
Copy link
Collaborator Author

OKay @Justinnn07 it would be better if you raise another PR for pagination changes and use this PR solely for State Management!

please do the necessary

Sure, will do!

@Justinnn07 Justinnn07 closed this Jun 2, 2021
@Justinnn07 Justinnn07 deleted the Justinnn07/stateManagement branch June 2, 2021 16:23
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.

Adding State Management
2 participants