- Switch redux -> Context
- Remove excess packages
This commit is contained in:
Daniel Mason 2021-03-31 19:14:22 +13:00
parent ebd88b3bb0
commit 65c092e4ee
Signed by: idanoo
GPG key ID: 387387CDBC02F132
14 changed files with 293 additions and 397 deletions

View file

@ -5,10 +5,16 @@ import { Button } from 'reactstrap';
import { Formik, Form, Field } from 'formik';
import ScaleLoader from 'react-spinners/ScaleLoader';
import AuthContext from '../Contexts/AuthContext';
import { useHistory } from "react-router";
const Login = () => {
const history = useHistory();
let boolTrue = true;
let { Login, loading } = useContext(AuthContext);
let { Login, loading, user } = useContext(AuthContext);
if (user) {
history.push("/dashboard");
}
return (
<div className="pageWrapper">