Skip to content

Commit

Permalink
aaaaaaaaaaaaaaaa
Browse files Browse the repository at this point in the history
  • Loading branch information
femathrl0 committed May 28, 2024
1 parent 08209f3 commit 54e4869
Showing 1 changed file with 0 additions and 65 deletions.
65 changes: 0 additions & 65 deletions frontend/src/pages/Login/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,67 +15,6 @@ function Login() {
};


const handleSenhaChange = (event) => {
setSenha(event.target.value);
};

const handleSubmit = (event) => {
event.preventDefault(); // previne que o usuário não mande o campo em branco
// manda o que o usuário enviou nos campos, para o console
console.log("Matrícula:", matricula);
console.log("Senha:", senha);

// limpa os campos após submeter os valores
setMatricula('');
setSenha('');

//alerta pra ver se esta recebendo os valores
alert("Matricula : " + matricula +" Senha: " + senha);
};

return (
<>
<body id="paginaLogin">
<div className='divC'>
<Link to="/">
<img className='img-setaLogin' src='/seta.svg' alt='seta' />
</Link>
<span className='title'>EDRA</span>
<span className='sub-title'>Entrar</span>
<form onSubmit={handleSubmit}>
<input
type="text"
placeholder='Matrícula'
value={matricula}
onChange={handleMatriculaChange}
pattern="[0-9]*"
maxLength={9}
/>
<input
type="password"
placeholder='Senha'
value={senha}
onChange={handleSenhaChange}
/>
<button type="submit">ENTRAR</button>
</form>
import React, { useState } from 'react';
import './Login.css';
import { Link } from 'react-router-dom';

function Login() {
const [matricula, setMatricula] = useState('');
const [senha, setSenha] = useState('');

const handleMatriculaChange = (event) => {
const { value } = event.target;
// Checa se o valor esta vazio ou se sao apenas numeros
if (value === '' || /^\d+$/.test(value)) {
setMatricula(value);
}
};


const handleSenhaChange = (event) => {
setSenha(event.target.value);
};
Expand Down Expand Up @@ -124,13 +63,9 @@ function Login() {
<p>Não possui conta? <Link to="/createAccount">Registrar-se</Link></p>
<p><Link to="/passwordRecovery">Esqueci a senha</Link></p>
</div>
<p>Não possui conta? <Link to="/createAccount">Registrar-se</Link></p>
<p><Link to="/passwordRecovery">Esqueci a senha</Link></p>
</div>
</body>
</>
);
);
}

export default Login;

0 comments on commit 54e4869

Please sign in to comment.