2022-07-07 19:15:14 +00:00
|
|
|
import React from "react";
|
2022-07-12 12:46:22 +00:00
|
|
|
import { AuthContext } from "../../context/Auth/AuthContext";
|
2022-01-06 01:26:15 +00:00
|
|
|
import { i18n } from "../../translate/i18n";
|
|
|
|
|
2022-07-19 20:18:36 +00:00
|
|
|
import ContainerLogin from "../../components/Base/ContainerLogin/ContainerLogin";
|
2022-07-12 21:49:11 +00:00
|
|
|
import VideoComponent from "../../components/VideoTag/VideoComponent";
|
2022-07-12 12:46:22 +00:00
|
|
|
import LoginForm from "../../components/LoginComponents/LoginForm/LoginForm";
|
2022-07-12 21:49:11 +00:00
|
|
|
import Company from "../../components/LoginComponents/CompanyLogo/Company";
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2022-07-07 19:15:14 +00:00
|
|
|
//! Can i Delete this comment above?
|
2022-01-06 01:26:15 +00:00
|
|
|
// const Copyright = () => {
|
|
|
|
// return (
|
|
|
|
// <Typography variant="body2" color="textSecondary" align="center">
|
|
|
|
// {"Copyleft "}
|
|
|
|
// <Link color="inherit" href="https://github.com/canove">
|
|
|
|
// Canove
|
|
|
|
// </Link>{" "}
|
|
|
|
// {new Date().getFullYear()}
|
|
|
|
// {"."}
|
|
|
|
// </Typography>
|
|
|
|
// );
|
|
|
|
// };
|
|
|
|
|
2022-07-07 19:15:14 +00:00
|
|
|
// const useStyles = makeStyles((theme) => ({
|
|
|
|
// paper: {
|
|
|
|
// marginTop: theme.spacing(8),
|
|
|
|
// display: "flex",
|
|
|
|
// flexDirection: "column",
|
|
|
|
// alignItems: "center",
|
|
|
|
// },
|
|
|
|
// avatar: {
|
|
|
|
// margin: theme.spacing(1),
|
|
|
|
// backgroundColor: theme.palette.secondary.main,
|
|
|
|
// },
|
|
|
|
// form: {
|
|
|
|
// width: "100%", // Fix IE 11 issue.
|
|
|
|
// marginTop: theme.spacing(1),
|
|
|
|
// },
|
|
|
|
// submit: {
|
|
|
|
// margin: theme.spacing(3, 0, 2),
|
|
|
|
// },
|
|
|
|
// }));
|
2022-01-06 01:26:15 +00:00
|
|
|
|
|
|
|
const Login = () => {
|
2022-07-12 12:46:22 +00:00
|
|
|
const [user, setUser] = React.useState({ email: "", password: "" });
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2022-07-12 12:46:22 +00:00
|
|
|
const { handleLogin } = React.useContext(AuthContext);
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2022-07-12 12:46:22 +00:00
|
|
|
const handleChangeInput = (e) => {
|
|
|
|
setUser({ ...user, [e.target.name]: e.target.value });
|
|
|
|
};
|
2022-01-06 01:26:15 +00:00
|
|
|
|
2022-07-12 12:46:22 +00:00
|
|
|
const handlSubmit = (e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
handleLogin(user);
|
|
|
|
};
|
2022-01-06 01:26:15 +00:00
|
|
|
|
|
|
|
return (
|
2022-07-07 19:15:14 +00:00
|
|
|
<ContainerLogin>
|
2022-07-12 21:49:11 +00:00
|
|
|
<VideoComponent width={"350px"} autoPlay muted loop position={"relative"} />
|
|
|
|
<LoginForm
|
|
|
|
handleChangeInput={handleChangeInput}
|
|
|
|
handlSubmit={handlSubmit}
|
|
|
|
user={user.email}
|
|
|
|
password={user.password}
|
|
|
|
/>
|
|
|
|
<Company />
|
2022-07-07 19:15:14 +00:00
|
|
|
</ContainerLogin>
|
2022-01-06 01:26:15 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Login;
|