diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index ab80f55..e5d16b0 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -1,12 +1,11 @@ import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Information from "@/app/Components/Global/Information/information"; import Receipt from "@/app/Components/Receipt/Receipt"; -import toast from "react-hot-toast"; - -import { GetStudent } from "@/app/lib/getStudent"; import "./addTime.css"; import Selection from "@/app/Components/Selection/Selection"; +import ShowError from "@/app/Components/Global/ShowError"; +import { GetRegisterStudent } from "@/app/lib/getRegisterStudent"; export default async function Page(props: { searchParams?: Promise<{ @@ -15,13 +14,14 @@ export default async function Page(props: { }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; + let errorMessage = ""; let student: any = null; if (numAcount) { - const result = await GetStudent(parseInt(numAcount)); + const result = await GetRegisterStudent(parseInt(numAcount)); if (result.error) { - toast.error("Alumno no encontrado"); + errorMessage = `${result.error}`; return; } else { student = result; @@ -30,6 +30,8 @@ export default async function Page(props: { return (
+ {errorMessage && } +

AGREGAR TIEMPO

diff --git a/app/(private)/Inscripcion/page.tsx b/app/(private)/Inscripcion/page.tsx index efa497d..1d08034 100644 --- a/app/(private)/Inscripcion/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -4,10 +4,12 @@ import Receipt from "@/app/Components/Receipt/Receipt"; import Selection from "@/app/Components/Selection/Selection"; import ShowError from "@/app/Components/Global/ShowError"; import { GetStudent } from "@/app/lib/getStudent"; -import "./inscripcion.css"; import Table from "@/app/Components/Global/table"; import { envConfig } from "@/app/lib/config"; +import "./inscripcion.css"; +import Inscripcion from "@/app/Components/Receipt/Inscripcion"; + if (!envConfig.apiUrl) { console.error("API URL is not defined in envConfig"); } @@ -123,20 +125,8 @@ export default async function Page(props: { {student && ( <>
- - - - +
)} diff --git a/app/Components/AsignacionMesas.tsx b/app/Components/AsignacionMesas.tsx index 2af6100..b87282a 100644 --- a/app/Components/AsignacionMesas.tsx +++ b/app/Components/AsignacionMesas.tsx @@ -1,19 +1,34 @@ "use client"; -import { SetStateAction, useState } from "react"; +import axios from "axios"; +import { SetStateAction, useEffect, useState } from "react"; +import { envConfig } from "../lib/config"; + +interface mesas { + idMesa: number; + active: number; +} export default function AsignacionMesas() { const [tiempo, setTiempo] = useState(""); + const [mesa, setMesa] = useState([]); + + useEffect(() => { + const getMesa = async() => { + const response = await axios.get(`${envConfig.apiUrl}/mesa/activo`); + setMesa(response.data); + }; + getMesa() + }, []); + return (
- {Data && ( + {data && (
- + setUbicacion(e.target.value)} /> - + setNombre(e.target.value)} + /> - setIdPlataforma(Number(e.target.value))} + > + + {plataforma.map((plat) => ( + + ))} - - setIdArea(Number(e.target.value))} + > + + {area.map((a) => ( + + ))} -
- - + +
+ +
)} diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 6a03ba4..b0e9029 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -101,7 +101,7 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { />
-
+
- +
diff --git a/app/Components/layout/BarNavigation/BarNavigation.css b/app/Components/layout/BarNavigation/BarNavigation.css index 475b510..6e42464 100644 --- a/app/Components/layout/BarNavigation/BarNavigation.css +++ b/app/Components/layout/BarNavigation/BarNavigation.css @@ -19,7 +19,7 @@ .barNavigation li { transition: all 0.3s ease; cursor: pointer; - color: white; + color: #585858; width: 100%; transition: background-color 0.3s ease, border 0.3s ease; font-size: 1.5rem; @@ -28,6 +28,8 @@ .barNavigation li:hover { background-color: #f3f4f6; color: black !important; + border-radius: 8px; + z-index: 2; } .menuToggle { @@ -64,7 +66,10 @@ flex-direction: column; top: 100%; width: 100%; - background-color: #003e79; + min-width: 200px; + border: 1px solid #cfcfcf; + border-radius: 8px; + background-color: #ffffff; transition: color 0.3s ease; transition: opacity 0.4s ease, max-height 0.4s ease; } @@ -102,7 +107,7 @@ height: 100%; align-items: center; justify-content: center; - color: #383838; + color: #545454; font-size: 1.5rem; padding: 1rem; } @@ -224,4 +229,4 @@ tbody { tbody { font-size: 1rem; } -} \ No newline at end of file +} diff --git a/app/Components/layout/Header/Header.module.css b/app/Components/layout/Header/Header.module.css index 0eb52bb..6ce8d21 100644 --- a/app/Components/layout/Header/Header.module.css +++ b/app/Components/layout/Header/Header.module.css @@ -79,11 +79,11 @@ .containerBarNav { display: flex; + align-items: center; width: 100%; height: 100%; padding-left: 110px; max-height: 60%; - align-items: end; } @media (max-width: 800px) { diff --git a/app/globals.css b/app/globals.css index 3dab631..6305e22 100644 --- a/app/globals.css +++ b/app/globals.css @@ -327,7 +327,7 @@ form { border-radius: 4px; background-color: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); - height: 100%; + height: fit-content; overflow: hidden; } @@ -364,7 +364,6 @@ form { .toggleContent { overflow-y: auto; - height: 450px; scrollbar-width: none; } diff --git a/app/lib/getRegisterStudent.ts b/app/lib/getRegisterStudent.ts new file mode 100644 index 0000000..79437f1 --- /dev/null +++ b/app/lib/getRegisterStudent.ts @@ -0,0 +1,34 @@ +import axios from "axios"; +import { envConfig } from "./config"; +import { redirect } from "next/navigation"; +import { cookies } from "next/headers"; + +if (!envConfig.apiUrl) { + console.error("API URL is not defined in envConfig"); +} + +export async function GetRegisterStudent(numAcount: number) { + const cookieStore = cookies(); + const token = (await cookieStore).get("token")?.value; + + if (!token) redirect("/"); + try { + const response = await axios.get( + `${envConfig.apiUrl}/alumno-inscrito/${numAcount}`, + { + headers: { + Authorization: `Bearer ${token}`, + }, + } + ); + + return response.data; + } catch (error: any) { + const msg = + error.response?.data?.message || + error.message || + "Error desconocido al obtener estudiante"; + return { error: msg }; + } +} +//IO