-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
caminho de tela incial para login criado #38
- Loading branch information
1 parent
b7151dc
commit 396b933
Showing
4 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* src/componentes/FormularioLogin.css */ | ||
form { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
max-width: 400px; | ||
margin: 50px auto; | ||
padding: 20px; | ||
border: 1px solid #ccc; | ||
border-radius: 10px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
background-color: #f9f9f9; | ||
} | ||
|
||
div { | ||
margin-bottom: 20px; | ||
} | ||
|
||
input { | ||
width: 100%; | ||
padding: 30px; /* Aumentar o padding para tornar os campos mais altos */ | ||
font-size: 16px; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
box-sizing: border-box; | ||
} | ||
|
||
button { | ||
padding: 30px; /* Aumentar o padding para tornar o botão mais alto */ | ||
font-size: 16px; | ||
background-color: #007BFF; | ||
color: white; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
} | ||
|
||
button:hover { | ||
background-color: #0056b3; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React, { useState } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; // Importa useNavigate | ||
import './FormularioLogin.css'; | ||
|
||
const FormularioLogin = () => { | ||
const [formData, setFormData] = useState({ | ||
username: '', | ||
password: '', | ||
}); | ||
|
||
const navigate = useNavigate(); // Inicializa o useNavigate | ||
|
||
const handleChange = (e) => { | ||
const { name, value } = e.target; | ||
setFormData((prevFormData) => ({ | ||
...prevFormData, | ||
[name]: value, | ||
})); | ||
}; | ||
|
||
const handleSubmit = (e) => { | ||
e.preventDefault(); | ||
console.log('Dados do login enviados:', formData); | ||
// Aqui você pode adicionar a lógica para enviar os dados para o servidor | ||
|
||
// Redireciona para a página de perfil após o envio do formulário | ||
navigate('/meu-perfil'); | ||
}; | ||
|
||
return ( | ||
<form onSubmit={handleSubmit}> | ||
<div> | ||
<input | ||
type="text" | ||
id="username" | ||
name="username" | ||
placeholder="Nome de usuário" | ||
value={formData.username} | ||
onChange={handleChange} | ||
/> | ||
</div> | ||
<div> | ||
<input | ||
type="password" | ||
id="password" | ||
name="password" | ||
placeholder="Senha" | ||
value={formData.password} | ||
onChange={handleChange} | ||
/> | ||
</div> | ||
<button type="submit">Entrar</button> | ||
</form> | ||
); | ||
}; | ||
|
||
export default FormularioLogin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters