-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inicio de sesión - HTML y CSS #64
The head ref may contain hidden characters: "InicioDeSesi\u00F3n"
Conversation
Agregar estado y funciones de manejo de errores al componente de inicio de sesión
console.log(window); | ||
console.log(window.localStorage); | ||
|
||
window.location.href = "/EstructuraDePerfil/1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La navegacion se hace con el hook, creo que se llamaba useNavigate()
o algo asi.
Similar a como hiciste en otras paginas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JLeonN la navegación se hace así:
const navigate = useNavigate(); |
Antes que nada, acordate SIEMPRE de buscar ejemplos en el codigo.
Es decir, siempre que tengas que hacer algo, busca cosas similares en el codigo.
Pensá que otras cosas iguales o parecidas pueden existir.
Por ejemplo, ya habias hecho ejemplos de navegacion cuando vas del participante a la lista del titulo, o cuando hay un error.
navegar("/")
frontend/src/API/Api.js
Outdated
|
||
// ----Login: | ||
// Usuario y contraseña 🔐 | ||
export async function InicioSesion(sesion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has programado 285647425 funciones, todas esmpiezan con minuscula y deben ser verbos o acciones.
Cambiar a inicarSesion
.
const [errorInicioSesion, setInicioSesion] = useState(false); | ||
const navegar = useNavigate(); | ||
|
||
const IniciarSesion = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Igual que mi comentario antrerior, debe empezar en minuscula y que la primera palabra sea un verbo.
// Tareas pendiente | ||
// 1 navegar al inicio | ||
// 2 guardar el token en la sesion ? buscar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Borrar estos comentarios.
// value={email} | ||
// onChange={(e) => setEmail(e.target.value)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto esta sin terminar.
// value={contraseña} | ||
// onChange={(e) => setContraseña(e.target.value)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esto esta sin terminar.
<button | ||
type="button" | ||
className="btn btn-dark" | ||
// onClick={IniciarSesion} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esta sin terminar.
@@ -0,0 +1,56 @@ | |||
import { Link } from "react-router-dom"; | |||
|
|||
const Registro = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si te sirve de ayuda, acordate de estas preguntas:
// Que muestra mi pantalla?
// -
//
// Variables del estado:
// -
//
// Acciones de la pantalla:
// -
//
// Pasos:
// 1. declarar los estados
// 2. asociar los estado al HTML
// 3. hacer una funcion para cada accion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Daleeeee, maní quemado!
No description provided.