se hicieron cambios en el diseño
This commit is contained in:
@@ -6,33 +6,55 @@ import IconCircle from "./IconCircle";
|
||||
import Button from "@/components/button";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Link from "next/link";
|
||||
import { getUserFromToken } from "@/components/Hook";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
|
||||
|
||||
export default function LandingBody() {
|
||||
const [saludo, setSaludo] = useState("");
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const user = getUserFromToken();
|
||||
const origen = user?.tipo;
|
||||
|
||||
|
||||
if (origen === "LOAD") {
|
||||
setSaludo("Bienvenido al módulo de carga de datos");
|
||||
} else if (origen === "RED") {
|
||||
setSaludo("Bienvenido usuario de red");
|
||||
} else if (origen === "AT") {
|
||||
setSaludo("Bienvenido usuario de AT");
|
||||
} else if (origen === "CORREO") {
|
||||
setSaludo("Bienvenido usuario de correo");
|
||||
} else if (origen === " SOLICITA") {
|
||||
setSaludo("Bienvenido usuario de prestamos PC Puma");
|
||||
}
|
||||
|
||||
}, [])
|
||||
|
||||
|
||||
const router = useRouter();
|
||||
return (
|
||||
|
||||
<motion.main
|
||||
className=""
|
||||
|
||||
initial={{ y: 50, opacity: 0 }}
|
||||
animate={{ y: 0, opacity: 1 }}
|
||||
transition={{ delay: 1, duration: 1 }}
|
||||
>
|
||||
|
||||
{
|
||||
saludo && <strong className="text-dorado mb-5">{saludo}</strong>
|
||||
}
|
||||
|
||||
<IconCircle delay={2} />
|
||||
|
||||
|
||||
|
||||
<strong className="text-dorado">Servicios PC PUMA y CEDETEC</strong>
|
||||
|
||||
|
||||
<div>
|
||||
<Link
|
||||
href="https://www.acatlan.unam.mx/pcpuma/"
|
||||
target="_blank"
|
||||
className="btn btn-azul btn-lg rounded-pill mt-3"
|
||||
>
|
||||
Conoce PCPUMA
|
||||
</Link>
|
||||
<div>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</motion.main>
|
||||
);
|
||||
}
|
||||
|
||||
+3
-3
@@ -40,10 +40,10 @@ const Home = () => {
|
||||
const items: HeaderItem[] = user
|
||||
? [
|
||||
{ label: "Inicio", page: "landing" },
|
||||
{ label: "Consulta", page: "consulta" },
|
||||
{ label: isCarga, page: "carga" as PageKey },
|
||||
|
||||
...(user.tipo === "LOAD"
|
||||
? [{ label: "Carga individual", page: "carga individual" as PageKey }]
|
||||
? [{ label: "Carga individual", page: "carga individual" as PageKey }, { label: "Consulta", page: "consulta" as PageKey }]
|
||||
: []),
|
||||
{ label: "Cerrar sesión", onClick: handleLogout },
|
||||
]
|
||||
@@ -60,7 +60,7 @@ const Home = () => {
|
||||
<div className="flex-grow-1 d-flex flex-column align-items-center justify-content-center text-center">
|
||||
{page === "landing" && <LandingBody />}
|
||||
{page === "login" && <LoginPage />}
|
||||
{page === "consulta" && <Consulta />}
|
||||
{page === "consulta" && user?.tipo === "LOAD" && <Consulta />}
|
||||
{page === "carga" && <Dashboard />}
|
||||
{page === "carga individual" && user?.tipo === "LOAD" && (
|
||||
<FormularioCargaIndividual />
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import React, { useState } from "react";
|
||||
import Input from "@/components/input";
|
||||
import Button from "@/components/button";
|
||||
import Link from "next/link";
|
||||
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
@@ -80,7 +81,7 @@ export default function Consulta() {
|
||||
|
||||
{usuario && (
|
||||
|
||||
<h2 className="text-xl font-semibold mb-4 mt-5">Bienvenido <span className="text-blue-700">{usuario}</span>, estos son tus servicios activos</h2>
|
||||
<h2 className="text-xl font-semibold mb-4 mt-5">Bienvenido <span className="text-blue-700">{usuario}</span></h2>
|
||||
|
||||
|
||||
)}
|
||||
@@ -141,6 +142,18 @@ export default function Consulta() {
|
||||
</tbody>
|
||||
</table>
|
||||
)}
|
||||
<div>
|
||||
<Link
|
||||
href="https://www.acatlan.unam.mx/pcpuma/"
|
||||
target="_blank"
|
||||
className="btn btn-azul btn-lg rounded-pill mt-5 mb-5"
|
||||
>
|
||||
Conoce PCPUMA
|
||||
</Link>
|
||||
<div>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export default function Page() {
|
||||
// Redirigir al usuario
|
||||
} catch (err: any) {
|
||||
const message =
|
||||
err.response?.data?.message || err.message || "Error al iniciar sesión";
|
||||
"credenciales incorrectas, por favor verifica tu usuario y contraseña";
|
||||
setError(message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user