diff --git a/src/pages/SignIn.js b/src/pages/SignIn.js index 33ba0f783b7ab17cef79edc5090935c67b4ab75f..f7d5a762955a6723e25d265bcee06e6bc0dac200 100644 --- a/src/pages/SignIn.js +++ b/src/pages/SignIn.js @@ -10,7 +10,7 @@ import FormInput from "../components/fieldsSignUp/FormInput"; import Paper from "@material-ui/core/Paper"; import api from "../api"; -const useStyles = makeStyles((theme) => ({ +const useStyles = makeStyles(theme => ({ register: { maxWidth: "1000px", background: "#ffffff", @@ -18,25 +18,25 @@ const useStyles = makeStyles((theme) => ({ padding: "2% 1%", margin: "0 auto", marginTop: "9%", - width: "95%", + width: "95%" }, custom_strong: { fontSize: "25px", textAlign: "center", display: "block", - color: "#46525d", + color: "#46525d" }, strong_description: { fontSize: "14px", - color: "#c2c6ca", + color: "#c2c6ca" }, form: { marginTop: "3%", alignItems: "center", - textAlign: "center", + textAlign: "center" }, noAcc: { - marginTop: "10px", + marginTop: "10px" }, button: { type: "submit", @@ -47,12 +47,12 @@ const useStyles = makeStyles((theme) => ({ padding: "10px 20px", fontSize: "18px", "&:hover": { - backgroundColor: "rgb(25, 109, 23)", + backgroundColor: "rgb(25, 109, 23)" }, ["@media (max-width:550px)"]: { - width: "55%", - }, - }, + width: "55%" + } + } })); export default function SignIn() { const classes = useStyles(); @@ -63,13 +63,13 @@ export default function SignIn() { const [values, setValues] = React.useState({ email: "", password: "", - emailError: false, + emailError: false }); async function update(prop, event) { await setValues({ ...values, [prop]: event.target.value }); } - const handleChange = (prop) => (event) => { + const handleChange = prop => event => { if (!checkEmail()) { values.emailError = true; } else { @@ -103,9 +103,9 @@ export default function SignIn() { const response = await api .post(`/user/signIn`, { email: values.email, - hash: values.password, + hash: values.password }) - .then(function (response) { + .then(function(response) { if (!response.data.error) { window.sessionStorage.setItem("token", response.data.token); window.sessionStorage.setItem("userId", response.data.id); @@ -113,7 +113,7 @@ export default function SignIn() { history.push(path); } }) - .catch(function (error) { + .catch(function(error) { if (error.response) { alert( "Falha de autenticação. Certifique-se que email e senha estão corretos." @@ -131,19 +131,19 @@ export default function SignIn() { const theme = createMuiTheme({ overrides: { root: { - color: "white", + color: "white" }, MuiInput: { underline: { "&:before": { - borderBottom: "1px solid #35c7fc", + borderBottom: "1px solid #35c7fc" }, "&:after": { - borderBottom: "1px solid #3f51b5", - }, - }, - }, - }, + borderBottom: "1px solid #3f51b5" + } + } + } + } }); return isLoged ? ( <Redirect to={`/list/${window.sessionStorage.getItem("userId")}`} /> @@ -175,7 +175,6 @@ export default function SignIn() { </Grid> <Grid> <IconButton - type="submit" size="medium" className={classes.button} id="whiteTextedButton"