From 9f45a40efffcd1dfa0dba78a64661508eb6edadd Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Thu, 23 Oct 2025 14:58:17 -0600 Subject: [PATCH] create new component call login --- src/app/page.tsx | 43 ++-------------- src/app/styles/layout/BarNavigation.scss | 9 ---- src/app/styles/layout/header.module.scss | 4 +- src/app/styles/layout/login.scss | 2 +- src/components/BarNavigation.tsx | 64 +----------------------- src/components/Login.tsx | 39 +++++++++++++++ 6 files changed, 47 insertions(+), 114 deletions(-) create mode 100644 src/components/Login.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index 75ca3f1..dfc23c1 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,40 +1,5 @@ -"use client"; // <-- OBLIGATORIO +import Login from "@/components/Login"; -import { useState } from "react"; -import { useRouter } from "next/navigation"; -import "../app/styles/layout/login.scss"; -export default function Login() { - const router = useRouter(); - const [email, setEmail] = useState(""); - const [password, setPassword] = useState(""); - const [error, setError] = useState(""); - - const mockUsers = [ - { email: "admin@escuela.com", password: "1234" }, - { email: "usuario@escuela.com", password: "abcd" }, - ]; - - const handleSubmit = (e: React.FormEvent) => { - e.preventDefault(); - const user = mockUsers.find(u => u.email === email && u.password === password); - - if (user) { - localStorage.setItem("loggedIn", "true"); - router.push("/dashboard"); - } else { - setError("Usuario o contraseña incorrectos"); - } - }; - - return ( -
-

Iniciar sesión

- {error &&

{error}

} -
- setEmail(e.target.value)} required /> - setPassword(e.target.value)} required /> - -
-
- ); -} \ No newline at end of file +export default function page() { + return ; +} diff --git a/src/app/styles/layout/BarNavigation.scss b/src/app/styles/layout/BarNavigation.scss index dd3dc50..9afbbb3 100644 --- a/src/app/styles/layout/BarNavigation.scss +++ b/src/app/styles/layout/BarNavigation.scss @@ -24,10 +24,6 @@ font-size: 1.5rem; } -.barNavigation li:hover { - background-color: #bd8c01; -} - .barNavigation ul.active { display: flex; width: 100%; @@ -109,11 +105,6 @@ font-size: 1.5rem; } -.subMenu:hover > span, -.subMenu > a:hover > span { - color: white; -} - .containerLinks { padding: 0 !important; border-radius: 0 0 4px 4px; diff --git a/src/app/styles/layout/header.module.scss b/src/app/styles/layout/header.module.scss index 2f2d107..a180c45 100644 --- a/src/app/styles/layout/header.module.scss +++ b/src/app/styles/layout/header.module.scss @@ -45,7 +45,7 @@ .header::after { content: ""; top: 0; - left: -40px; + left: -60px; position: absolute; background-color: #003e79; height: 100%; @@ -57,7 +57,7 @@ .header::before { content: ""; top: 0; - left: -20px; + left: -40px; position: absolute; background-color: rgb(1, 92, 184); height: 100%; diff --git a/src/app/styles/layout/login.scss b/src/app/styles/layout/login.scss index 70631b9..79be2d2 100644 --- a/src/app/styles/layout/login.scss +++ b/src/app/styles/layout/login.scss @@ -1,7 +1,7 @@ .login-container { width: 300px; margin: 100px auto; - padding: 30px; + padding: 2rem; border: 1px solid #ccc; border-radius: 10px; background: #f8f9fa; diff --git a/src/components/BarNavigation.tsx b/src/components/BarNavigation.tsx index d87db01..83c2877 100644 --- a/src/components/BarNavigation.tsx +++ b/src/components/BarNavigation.tsx @@ -23,68 +23,6 @@ function BarNavigation() {