-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/stephin007/cowin-vaccine-availablity-checker/B9RRXhquuYjG7dMBk6YQT7kLkGnk |
@stephin007 pls review and merge! |
import { GlobalStyles } from "./components/globalStyles"; | ||
import { useDarkMode } from "./Themes/useDarkMode"; | ||
import { lightTheme, darkTheme } from "./Themes/themes"; | ||
import { GlobalStyles } from "./Themes/globalStyles"; |
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.
@Justinnn07 why the name of the folder was changed?
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.
@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()); |
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.
@Justinnn07 why are the above states not used under context?
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.
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"; | |||
|
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.
these icons are not needed? @Justinnn07
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 am making the UI of the pagination little attractive .. moreover, the prev button was not working tooo!
@Justinnn07 Can you also add the api calls to state? i mean right now we are adding only the states! |
@Justinnn07 Also Please fill the PR Template! |
Is it necessary ? I am adding every api response to the reducer |
sure! |
State management means writing less code right? is this possible what i said? |
Also, @Justinnn07 are you removing pagination? |
Ohk :) |
No, I will be using Material-ui Pagination |
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! |
Please check if the PR fulfills these requirements
Describe your changes
Bought State management(React context API ) to the app ..
We can now access the req. data on any component!
❤️ Thank you!