diff --git a/src/app/(auth)/old_login.tsx b/src/app/(auth)/old_login.tsx new file mode 100644 index 0000000..af2602e --- /dev/null +++ b/src/app/(auth)/old_login.tsx @@ -0,0 +1,132 @@ +"use client"; + +import Input from "@/components/input"; +import PasswordInput from "@/components/password"; +import { useState } from "react"; +import axios from "axios"; +import { useRouter } from "next/navigation"; + + +export default function Login() { + const [value, setValue] = useState(''); + const [password, setPassword] = useState(''); + const [error, setError] = useState(''); + const router = useRouter(); + + const handleLogin = async () => { + try { + const response = await axios.post('http://localhost:4000/login', { + email: value, + password: password, + }); + + + + const token = response.data.access_token; + localStorage.setItem('token', token); + + // Redirige al usuario + window.location.href = '/carga'; + } catch (err: any) { + const message = + err.response?.data?.message || + err.message || + 'Error al iniciar sesión'; + setError(message); + } + }; + + return ( +
+
+
+

Inicio de sesión

+

Sistema de --------

+ + setValue(e.target.value)} + /> + + setPassword(e.target.value)} + /> + + {error && ( +

{error}

+ )} + +
+ + + + +
+
+
+
+ ); +} \ No newline at end of file diff --git a/src/app/carga/page.tsx b/src/app/carga/page.tsx index 47c3cab..55bdade 100644 --- a/src/app/carga/page.tsx +++ b/src/app/carga/page.tsx @@ -70,8 +70,7 @@ export default function Dashboard() { className="flex gap-4 flex-wrap mb-6" style={{ padding: "2rem", - borderRadius: "8px", - boxShadow: "0 4px 6px rgba(253, 253, 253, 0.1)", + width: "100%", }} > diff --git a/src/app/visualizacion/page.tsx b/src/app/visualizacion/page.tsx index ad08156..0f491ff 100644 --- a/src/app/visualizacion/page.tsx +++ b/src/app/visualizacion/page.tsx @@ -56,8 +56,7 @@ export default function Consulta() { className="flex gap-4 flex-wrap mb-6" style={{ padding: "2rem", - borderRadius: "8px", - boxShadow: "0 4px 6px rgba(253, 253, 253, 0.1)", + width: "100%", maxWidth: "900px", }} diff --git a/tsconfig.json b/tsconfig.json index c133409..ce5a484 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,6 @@ "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/landing"], "exclude": ["node_modules"] }