From 73bbe6a52a22d76e72e1a3516c11f8fa7ea8c743 Mon Sep 17 00:00:00 2001 From: IO420 Date: Sun, 21 Sep 2025 00:07:55 -0600 Subject: [PATCH 1/9] new style --- app/(private)/AgregarTiempo/page.tsx | 9 +- app/Components/AlertBox/AlertBox.css | 2 +- .../BarNavigation/BarNavigation.css | 230 +++++++++--------- .../BarNavigation/BarNavigation.tsx | 4 +- app/Components/Logout/Logout.css | 2 +- app/Routes/LoginRedirect.tsx | 20 +- app/Routes/PrivateRoute.tsx | 2 +- app/globals.css | 20 +- app/layout.tsx | 2 +- app/page.tsx | 2 +- middleware.ts | 18 +- 11 files changed, 152 insertions(+), 159 deletions(-) diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index c7a081d..d2e84ef 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -7,10 +7,9 @@ import "./addTime.css"; export default async function Page({ searchParams }: any) { - const numAccount = searchParams?.numAccount - ? Number(searchParams.numAccount) - : null; - + const params =await searchParams; + const numAccount = params.numAccount ? Number(params.numAccount) : null; + let student: any = null; if (numAccount) { student = await GetStudent(numAccount); @@ -27,7 +26,7 @@ export default async function Page({ searchParams }: any) {
- +
) : ( diff --git a/app/Components/AlertBox/AlertBox.css b/app/Components/AlertBox/AlertBox.css index 866d28f..f33818d 100644 --- a/app/Components/AlertBox/AlertBox.css +++ b/app/Components/AlertBox/AlertBox.css @@ -4,7 +4,7 @@ padding: 0.5rem 1.25rem; border-radius: 0 4px 4px 0; font-weight: bold; - font-size: 1.5rem; + font-size: 2rem; text-align: center; opacity: 1; z-index: 100; diff --git a/app/Components/BarNavigation/BarNavigation.css b/app/Components/BarNavigation/BarNavigation.css index 63c86ec..38de740 100644 --- a/app/Components/BarNavigation/BarNavigation.css +++ b/app/Components/BarNavigation/BarNavigation.css @@ -1,173 +1,173 @@ .barNavigation { - text-align: center; - background-color: rgb(1, 92, 184); - padding: 0 20px; - display: flex; - width: 100%; - top: 0; - min-height: 40px; + text-align: center; + background-color: rgb(1, 92, 184); + padding: 0 20px; + display: flex; + width: 100%; + top: 0; + min-height: 40px; } .barNavigation ul { - display: flex; - justify-content: space-around; - width: 100%; + display: flex; + justify-content: space-around; + width: 100%; } .barNavigation li { - transition: all 0.3s ease; - cursor: pointer; - color: white; - font-weight: bold; - width: 100%; - transition: background-color 0.3s ease; + transition: all 0.3s ease; + cursor: pointer; + color: white; + font-weight: bold; + width: 100%; + transition: background-color 0.3s ease; + font-size: 2rem; } .barNavigation li:hover { - background-color: #d59f0f; + background-color: #d59f0f; } .barNavigation ul.active { - display: flex; - width: 100%; + display: flex; + width: 100%; } .menuToggle { - display: none; - flex-direction: column; - align-items: center; - gap: 4px; - cursor: pointer; - padding: 10px; - margin-right: 10px; + display: none; + flex-direction: column; + align-items: center; + gap: 4px; + cursor: pointer; + padding: 10px; + margin-right: 10px; } .menuToggle div { - width: 25px; - height: 3px; - background-color: white; - border-radius: 4px; + width: 25px; + height: 3px; + background-color: white; + border-radius: 4px; } .subMenu { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width: 100%; - gap: 10px; - position: relative; - z-index: 1; - border-radius: 4px 4px 0 0; - padding: 5px 0; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + gap: 10px; + position: relative; + z-index: 1; + border-radius: 4px 4px 0 0; } .subMenu ul { - display: none; - position: absolute; - flex-direction: column; - top: 100%; - width: 100%; - background-color: rgba(0, 61, 121, 1); - transition: color 0.3s ease, opacity 0.3s ease; + display: none; + position: absolute; + flex-direction: column; + top: 100%; + width: 100%; + background-color: rgba(0, 61, 121, 1); + transition: color 0.3s ease, opacity 0.3s ease; } .subMenu.open ul { - display: flex; - color: rgba(0, 61, 121, 1); + display: flex; + color: rgba(0, 61, 121, 1); } .subMenu ul:hover { - color: #5b8cc9; + color: #5b8cc9; } .subMenu:hover ul { - display: flex; + display: flex; } .subMenu li { - padding: 10px 0; + padding: 10px 0; } .subMenu span { - display: flex; - width: 100%; - height: 100%; - align-items: center; - justify-content: center; - color: rgb(255, 255, 255); - font-size: 1.5rem; + display: flex; + width: 100%; + height: 100%; + align-items: center; + justify-content: center; + color: rgb(255, 255, 255); + font-size: 2rem; } .containerLinks { - padding: 0 !important; - border-radius: 0 0 4px 4px; + padding: 0 !important; + border-radius: 0 0 4px 4px; } .links { - display: flex; - justify-content: center; - align-items: center; - color: white; - width: 100%; - height: 100%; - font-size: 1.5rem; + display: flex; + justify-content: center; + align-items: center; + color: white; + width: 100%; + height: 100%; + font-size: 1.5rem; } -thead,tbody{ - font-size: 1.25rem; +thead, +tbody { + font-size: 1.25rem; } @media (max-width: 800px) { + .menuToggle { + display: flex; + position: relative; + align-items: end; + transition: transform 0.3s ease; + } - .menuToggle { - display: flex; - position: relative; - align-items: end; - transition: transform 0.3s ease; - } + .menuToggle.center { + align-items: center; + margin: 0; + } - .menuToggle.center { - align-items: center; - margin: 0; - } + .barNavigation { + font-size: 15px; + display: block; + } - .barNavigation { - font-size: 15px; - display: block; - } + .barNavigation ul { + position: absolute; + background-color: rgb(1, 92, 184); + flex-direction: column; + padding: 10px 0; + align-items: center; + display: none; + z-index: 1; + height: auto; + } - .barNavigation ul { - position: absolute; - background-color: rgb(1, 92, 184); - flex-direction: column; - padding: 10px 0; - align-items: center; - display: none; - z-index: 1; - height: auto; - } + .barNavigation { + padding: 0; + } - .barNavigation { - padding: 0; - } + .barNavigation li:hover { + background-color: #d59f0f; + color: white; + border-radius: 0; + border: none; + } - .barNavigation li:hover { - background-color: #d59f0f; - color: white; - border-radius: 0; - border: none; - } + .subMenu ul { + width: 90%; + border-radius: 4px; + position: relative; + background-color: rgba(0, 61, 121, 1); + } - .subMenu ul { - width: 90%; - border-radius: 4px; - position: relative; - background-color: rgba(0, 61, 121, 1); - } - - thead,tbody{ - font-size: 1rem; - } - -} \ No newline at end of file + thead, + tbody { + font-size: 1rem; + } +} diff --git a/app/Components/BarNavigation/BarNavigation.tsx b/app/Components/BarNavigation/BarNavigation.tsx index 0066584..ad4ac0e 100644 --- a/app/Components/BarNavigation/BarNavigation.tsx +++ b/app/Components/BarNavigation/BarNavigation.tsx @@ -90,12 +90,12 @@ function BarNavigation() {
  • - Quitar sancion + Quitar sancion
  • - Cambiar contraseña + Cambiar contraseña
  • diff --git a/app/Components/Logout/Logout.css b/app/Components/Logout/Logout.css index 44f2c9a..98fc11a 100644 --- a/app/Components/Logout/Logout.css +++ b/app/Components/Logout/Logout.css @@ -14,7 +14,7 @@ @media (max-width: 800px) { .button-logout { color: transparent; - padding: 1.5rem; + padding: 2rem; font-size: 0px; top: 15px; } diff --git a/app/Routes/LoginRedirect.tsx b/app/Routes/LoginRedirect.tsx index f1daf17..80df000 100644 --- a/app/Routes/LoginRedirect.tsx +++ b/app/Routes/LoginRedirect.tsx @@ -5,17 +5,17 @@ import { useRouter } from "next/navigation"; import { useEffect } from "react"; export const LoginRedirect = ({ children }: { children: React.ReactNode }) => { - const { loading, authenticated } = useAuth(); - const router = useRouter(); + const { loading, authenticated } = useAuth(); + const router = useRouter(); - useEffect(() => { - if (!loading && authenticated) { - router.push("/Impresiones"); - } - }, [loading, authenticated, router]); + useEffect(() => { + if (!loading && authenticated) { + router.push("/Impresiones"); + } + }, [loading, authenticated, router]); - if (loading) return

    Cargando...

    ; + if (loading) return

    Cargando...

    ; - return !authenticated ? <>{children} : null; + return !authenticated ? <>{children} : null; }; -//IO \ No newline at end of file +//IO diff --git a/app/Routes/PrivateRoute.tsx b/app/Routes/PrivateRoute.tsx index a3c679a..8342c1c 100644 --- a/app/Routes/PrivateRoute.tsx +++ b/app/Routes/PrivateRoute.tsx @@ -18,4 +18,4 @@ export const PrivateRoute = ({ children }: { children: React.ReactNode }) => { return authenticated ? <>{children} : null; }; -//IO \ No newline at end of file +//IO diff --git a/app/globals.css b/app/globals.css index 7eee956..86aef13 100644 --- a/app/globals.css +++ b/app/globals.css @@ -153,18 +153,18 @@ select { border: 1px solid #cfcfcf; background-color: #fff; border-radius: 4px; - font-size: 1.5rem; + font-size: 2rem; color: black; } label { - font-size: 1.5rem; + font-size: 2rem; font-weight: bold; display: block; } button { - font-size: 1.5rem; + font-size: 2rem; padding: 1rem 1.75rem; border-radius: 4px; cursor: pointer; @@ -252,7 +252,7 @@ a { top: 0; left: 0; width: 100%; - font-size: 2.5rem; + font-size: 3rem; font-weight: bold; text-align: start; border-bottom: 1px solid #cfcfcf; @@ -369,6 +369,16 @@ table tr { text-align: start; } +.loginContainer { + position: relative; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + width: 100%; +} + @media (max-width: 1300px) { .container { width: 100%; @@ -436,7 +446,7 @@ table tr { footer p { font-size: 1.2rem; -} + } } @media (max-height: 960px) { diff --git a/app/layout.tsx b/app/layout.tsx index 2d12ac2..861eace 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -26,7 +26,7 @@ export default function RootLayout({ }>) { return ( - +
    {children} diff --git a/app/page.tsx b/app/page.tsx index 09d452b..77be5b0 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -3,7 +3,7 @@ import { LoginRedirect } from "./Routes/LoginRedirect"; export default function Home() { return ( -
    +
    diff --git a/middleware.ts b/middleware.ts index 4f554d5..3789498 100644 --- a/middleware.ts +++ b/middleware.ts @@ -13,22 +13,6 @@ export function middleware(request: NextRequest) { } export const config = { - matcher: [ - "/Reportes", - "/Monitor", - "/QuitarSancion", - "/Programas", - "/Mensajes", - "/Inscritos", - "/Inscripciones", - "/InformacionEquipo", - "/Impresiones", - "/CambiarPass", - "/BitacoraSanciones", - "/AsignacionMesas", - "/AsignacionEquipo", - "/Alta", - "/AgregarTiempo", - "/ActivosMantenimiento"], + matcher: [] }; //IO From 079ba1509972b3fb3672be073961ed452d6ac89e Mon Sep 17 00:00:00 2001 From: IO420 Date: Mon, 22 Sep 2025 05:27:32 -0600 Subject: [PATCH 2/9] fixed searchParams --- app/(private)/AgregarTiempo/page.tsx | 10 +++++++--- app/(private)/BitacoraSanciones/page.tsx | 9 +++++++-- app/(private)/Impresiones/page.tsx | 12 ++++++++---- app/(private)/Inscripciones/page.tsx | 16 +++++++++++----- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index d2e84ef..e74906e 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -5,10 +5,14 @@ import { GetStudent } from "@/app/lib/getStudent"; import "./addTime.css"; -export default async function Page({ searchParams }: any) { +export default async function Page(props:{ + searchParams?: Promise<{ + numAcount:string; + }> +}) { - const params =await searchParams; - const numAccount = params.numAccount ? Number(params.numAccount) : null; + const params =await props.searchParams; + const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; if (numAccount) { diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 66b5906..133d7c9 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -8,8 +8,13 @@ import Information from "@/app/Components/Information/information"; import SearchUser from "@/app/Components/SearchUser/searchUser"; import { GetStudent } from "@/app/lib/getStudent"; -export default function Page({ searchParams }: any) { - const params = searchParams; +export default async function Page(props:{ + searchParams?: Promise<{ + numAcount:string; + }> +}) { + const params =await props.searchParams; + const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; let error: string | null = null; diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index b72beac..b64610f 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -8,9 +8,13 @@ import AlertBox from "@/app/Components/AlertBox/AlertBox"; import { GetStudent } from "@/app/lib/getStudent"; import "@/app/globals.css"; -export default async function Page({ searchParams }: any) { - const params = await searchParams; - const numAccount = params.numAccount ? Number(params.numAccount) : null; +export default async function Page(props: { + searchParams?: Promise<{ + numAcount: string; + }>; +}) { + const params = await props.searchParams; + const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; let error: string | null = null; @@ -46,7 +50,7 @@ export default async function Page({ searchParams }: any) { { key: "1", label: "Recibo", - content: , + content: , }, { key: "2", diff --git a/app/(private)/Inscripciones/page.tsx b/app/(private)/Inscripciones/page.tsx index da37631..761cca2 100644 --- a/app/(private)/Inscripciones/page.tsx +++ b/app/(private)/Inscripciones/page.tsx @@ -1,5 +1,3 @@ -import "./inscriptions.css"; - import SearchUser from "@/app/Components/SearchUser/searchUser"; import Information from "@/app/Components/Information/information"; import StepNavigator from "@/app/Components/StepNavigator/StepNavigator"; @@ -7,9 +5,16 @@ import Receipt from "@/app/Components/Receipt/Receipt"; import Selection from "@/app/Components/Selection/Selection"; import { GetStudent } from "@/app/lib/getStudent"; -export default async function Page({ searchParams }: any) { - const params = await searchParams; - const numAccount = params.numAccount ? Number(params.numAccount) : null; +import "./inscriptions.css"; + +export default async function Page(props:{ + searchParams?: Promise<{ + numAcount:string; + }> +}) { + + const params =await props.searchParams; + const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; let error: string | null = null; @@ -49,3 +54,4 @@ export default async function Page({ searchParams }: any) { ); } +//IO \ No newline at end of file From 1e081dfe791d3bfc8c718be638f19f8fdba0eb3f Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 22 Sep 2025 12:15:32 -0400 Subject: [PATCH 3/9] new style and fixed request --- .example.txt | 1 - app/(private)/AgregarTiempo/page.tsx | 8 ++--- app/(private)/BitacoraSanciones/page.tsx | 2 +- app/(private)/Impresiones/page.tsx | 16 +++++----- app/(private)/Inscripciones/page.tsx | 8 ++--- app/Components/Impressions/impressions.tsx | 8 ++--- app/Components/Receipt/Receipt.tsx | 8 ++--- app/Components/SearchUser/searchUser.tsx | 10 +++--- app/globals.css | 37 ++++++++++++++++++++-- app/lib/getStudent.ts | 4 +-- 10 files changed, 67 insertions(+), 35 deletions(-) delete mode 100644 .example.txt diff --git a/.example.txt b/.example.txt deleted file mode 100644 index 4b73e25..0000000 --- a/.example.txt +++ /dev/null @@ -1 +0,0 @@ -NEXT_PUBLIC_API_URL= \ No newline at end of file diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index e74906e..357d2ba 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -12,11 +12,11 @@ export default async function Page(props:{ }) { const params =await props.searchParams; - const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; + const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; - if (numAccount) { - student = await GetStudent(numAccount); + if (numAcount) { + student = await GetStudent(numAcount); } return ( @@ -30,7 +30,7 @@ export default async function Page(props:{
    - +
    ) : ( diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 133d7c9..d9c8234 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -14,7 +14,7 @@ export default async function Page(props:{ }> }) { const params =await props.searchParams; - const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; + const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; let error: string | null = null; diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index b64610f..715ce2b 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -14,12 +14,12 @@ export default async function Page(props: { }>; }) { const params = await props.searchParams; - const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; + const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; let error: string | null = null; - if (numAccount) { - const result = await GetStudent(numAccount); + if (numAcount) { + const result = await GetStudent(numAcount); if (result.error) { error = result.error; @@ -50,7 +50,7 @@ export default async function Page(props: { { key: "1", label: "Recibo", - content: , + content: , }, { key: "2", @@ -58,7 +58,7 @@ export default async function Page(props: { content: ( ), }, @@ -77,7 +77,7 @@ export default async function Page(props: { { value: 12 }, { value: 14 }, ]} - numAccount={student.id_cuenta} + numAcount={student.id_cuenta} /> ), }, @@ -105,7 +105,7 @@ export default async function Page(props: { { value: 150 }, { value: 200 }, ]} - numAccount={student.id_cuenta} + numAcount={student.id_cuenta} /> ), }, @@ -115,7 +115,7 @@ export default async function Page(props: { content: ( ), }, diff --git a/app/(private)/Inscripciones/page.tsx b/app/(private)/Inscripciones/page.tsx index 761cca2..2fac6cc 100644 --- a/app/(private)/Inscripciones/page.tsx +++ b/app/(private)/Inscripciones/page.tsx @@ -14,12 +14,12 @@ export default async function Page(props:{ }) { const params =await props.searchParams; - const numAccount = params?.numAcount ? parseInt(params.numAcount) : null; + const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; let student: any = null; let error: string | null = null; - if (numAccount) { - const result = await GetStudent(numAccount); + if (numAcount) { + const result = await GetStudent(numAcount); if (result.error) { error = result.error; @@ -45,7 +45,7 @@ export default async function Page(props:{ - + ) : ( diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 9f0baa5..ed38e5b 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -14,10 +14,10 @@ interface CostOption { interface ImpressionsProps { costs: CostOption[]; - numAccount: number | null; + numAcount: number | null; } -function Impressions({ costs, numAccount }: ImpressionsProps) { +function Impressions({ costs, numAcount }: ImpressionsProps) { const [pages, setPages] = useState(""); const [cost, setCost] = useState(""); @@ -33,7 +33,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) { const handlePayment = async () => { setError(""); - if (!numAccount) { + if (!numAcount) { setError("Error busca denuevo al estudiante"); return; } @@ -49,7 +49,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) { } const result = await PostImpressions({ - id_cuenta:numAccount, + id_cuenta:numAcount, numero_hojas : parseInt(pages), monto: parseInt(cost) * parseInt(pages), }); diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index ba453b5..0d19218 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -7,10 +7,10 @@ import Cookies from "js-cookie"; import "./Receipt.css"; interface ReceiptsProps { - numAccount: number | null; + numAcount: number | null; } -function Receipt({ numAccount }: ReceiptsProps) { +function Receipt({ numAcount }: ReceiptsProps) { const [folio, setFolio] = useState(""); const [amount, setAmount] = useState(""); const [date, setDate] = useState(""); @@ -29,7 +29,7 @@ function Receipt({ numAccount }: ReceiptsProps) { //restrict this month// const handleSaveReceipt = () => { - if (!numAccount) { + if (!numAcount) { setError("Error busca denuevo al estudiante"); return; } @@ -50,7 +50,7 @@ function Receipt({ numAccount }: ReceiptsProps) { } PostReceipt({ - id_cuenta: numAccount, + id_cuenta: numAcount, folio_recibo: folio, monto: Number(amount), fecha_recibo: date, diff --git a/app/Components/SearchUser/searchUser.tsx b/app/Components/SearchUser/searchUser.tsx index 74f01d4..6af7039 100644 --- a/app/Components/SearchUser/searchUser.tsx +++ b/app/Components/SearchUser/searchUser.tsx @@ -8,14 +8,14 @@ interface urlProp{ } function SearchUser(url:urlProp) { - const [numAccount, setNumAccount] = useState(""); + const [numAcount, setnumAcount] = useState(""); const router = useRouter(); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); - if (numAccount) { - router.push(`/${url.urlBase}?numAccount=${numAccount}`); + if (numAcount) { + router.push(`/${url.urlBase}?numAcount=${numAcount}`); } }; @@ -27,11 +27,11 @@ function SearchUser(url:urlProp) {
    { const value = e.target.value; if (/^\d*$/.test(value) && value.length <= 9) { - setNumAccount(value); + setnumAcount(value); } }} placeholder="Coloca un número de cuenta..." diff --git a/app/globals.css b/app/globals.css index 86aef13..b4aec32 100644 --- a/app/globals.css +++ b/app/globals.css @@ -13,6 +13,7 @@ html { box-sizing: border-box; font-size: 62.5%; + overflow-y: auto; } body { @@ -101,7 +102,7 @@ footer p { border-radius: 4px; width: 90%; max-width: 1150px; - height: 550px; + height: 600px; min-height: 520px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); overflow: hidden; @@ -297,13 +298,14 @@ form { .toggleButton { flex: 1; - padding: 0.5rem 1rem; background-color: transparent; border: none; cursor: pointer; border-radius: 4px; transition: background-color 0.3s, color 0.3s; font-weight: 500; + overflow-y: hidden; + max-height: 60px; } .toggleButton.active { @@ -379,6 +381,12 @@ table tr { width: 100%; } +@media(max-width: 1330px) { + .mainContainer { + grid-template-rows: 60px 1fr; + } +} + @media (max-width: 1300px) { .container { width: 100%; @@ -402,6 +410,10 @@ table tr { border-radius: 0; } + .mainContainer { + grid-template-rows: 40px 1fr; + } + .img { right: 50%; transform: translateX(50%); @@ -447,6 +459,20 @@ table tr { footer p { font-size: 1.2rem; } + + label { + font-size: 1.5rem; + } + + input, + select { + font-size: 1.5rem; + } + + button { + font-size: 1.5rem; + padding: 1rem 1.5rem; +} } @media (max-height: 960px) { @@ -454,3 +480,10 @@ table tr { margin: 0; } } + +@media (max-width: 450px) { + .title { + max-width: 300px; + overflow-wrap: break-word; + } +} \ No newline at end of file diff --git a/app/lib/getStudent.ts b/app/lib/getStudent.ts index 756ea2c..5e0f4f5 100644 --- a/app/lib/getStudent.ts +++ b/app/lib/getStudent.ts @@ -1,9 +1,9 @@ import axios from "axios"; import { envConfig } from "./config"; -export async function GetStudent(numAccount: number) { +export async function GetStudent(numAcount: number) { try { - const response = await axios.get(`${envConfig.apiUrl}/student/${numAccount}`); + const response = await axios.get(`${envConfig.apiUrl}/student/${numAcount}`); console.log(response.data) return response.data; } catch (error: any) { From 91f7a4c36589d2816b56ca9729d24092cbed499e Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 22 Sep 2025 10:32:05 -0600 Subject: [PATCH 4/9] merge Lino --- app/globals.css | 55 +++++++++++++++++++++++++++++++++++++++++++------ app/layout.tsx | 5 ++--- app/page.tsx | 4 ++-- 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/app/globals.css b/app/globals.css index 7eee956..b4aec32 100644 --- a/app/globals.css +++ b/app/globals.css @@ -13,6 +13,7 @@ html { box-sizing: border-box; font-size: 62.5%; + overflow-y: auto; } body { @@ -101,7 +102,7 @@ footer p { border-radius: 4px; width: 90%; max-width: 1150px; - height: 550px; + height: 600px; min-height: 520px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); overflow: hidden; @@ -153,18 +154,18 @@ select { border: 1px solid #cfcfcf; background-color: #fff; border-radius: 4px; - font-size: 1.5rem; + font-size: 2rem; color: black; } label { - font-size: 1.5rem; + font-size: 2rem; font-weight: bold; display: block; } button { - font-size: 1.5rem; + font-size: 2rem; padding: 1rem 1.75rem; border-radius: 4px; cursor: pointer; @@ -252,7 +253,7 @@ a { top: 0; left: 0; width: 100%; - font-size: 2.5rem; + font-size: 3rem; font-weight: bold; text-align: start; border-bottom: 1px solid #cfcfcf; @@ -297,13 +298,14 @@ form { .toggleButton { flex: 1; - padding: 0.5rem 1rem; background-color: transparent; border: none; cursor: pointer; border-radius: 4px; transition: background-color 0.3s, color 0.3s; font-weight: 500; + overflow-y: hidden; + max-height: 60px; } .toggleButton.active { @@ -369,6 +371,22 @@ table tr { text-align: start; } +.loginContainer { + position: relative; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + width: 100%; +} + +@media(max-width: 1330px) { + .mainContainer { + grid-template-rows: 60px 1fr; + } +} + @media (max-width: 1300px) { .container { width: 100%; @@ -392,6 +410,10 @@ table tr { border-radius: 0; } + .mainContainer { + grid-template-rows: 40px 1fr; + } + .img { right: 50%; transform: translateX(50%); @@ -436,6 +458,20 @@ table tr { footer p { font-size: 1.2rem; + } + + label { + font-size: 1.5rem; + } + + input, + select { + font-size: 1.5rem; + } + + button { + font-size: 1.5rem; + padding: 1rem 1.5rem; } } @@ -444,3 +480,10 @@ table tr { margin: 0; } } + +@media (max-width: 450px) { + .title { + max-width: 300px; + overflow-wrap: break-word; + } +} \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index 2d12ac2..e207c3f 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,9 +2,8 @@ import type { Metadata } from "next"; import { Poppins } from "next/font/google"; import Header from "./Components/Header/Header"; import Footer from "./Components/Footer/Footer"; -import BarNavigation from "./Components/BarNavigation/BarNavigation"; -import "./globals.css"; import WavesBackground from "./Components/Wave/wavesBack"; +import "./globals.css"; const poppins = Poppins({ variable: "--font-poppins", @@ -37,4 +36,4 @@ export default function RootLayout({ ); } -//IO +//IO \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index 09d452b..3790a03 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -3,7 +3,7 @@ import { LoginRedirect } from "./Routes/LoginRedirect"; export default function Home() { return ( -
    +
    @@ -13,4 +13,4 @@ export default function Home() {
    ); } -//IO +//IO \ No newline at end of file From 79e9844303890eba6dddc820fdb9862acd2e977d Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 22 Sep 2025 11:57:52 -0600 Subject: [PATCH 5/9] added functionalitie to impressions --- app/(private)/Impresiones/page.tsx | 25 ++-- app/Components/AlertBox/AlertBox.tsx | 2 +- .../FallingSquares/FallingSquares.tsx | 12 ++ app/Components/FallingSquares/style.css | 117 ++++++++++++++++++ app/Components/Impressions/impressions.tsx | 35 +++--- app/Components/Receipt/Receipt.tsx | 56 +++++---- app/Components/SearchUser/searchUser.tsx | 13 +- app/Components/Wave/wave.module.css | 1 + app/Components/Wave/wavesBack.tsx | 2 + app/globals.css | 4 +- app/layout.tsx | 4 +- app/not-found.tsx | 2 +- middleware.ts | 19 ++- 13 files changed, 240 insertions(+), 52 deletions(-) create mode 100644 app/Components/FallingSquares/FallingSquares.tsx create mode 100644 app/Components/FallingSquares/style.css diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 715ce2b..3da83c2 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -3,26 +3,29 @@ import Receipt from "../../Components/Receipt/Receipt"; import Impressions from "../../Components/Impressions/impressions"; import Toggle from "../../Components/Toggle/Toggle"; import Information from "../../Components/Information/information"; - import AlertBox from "@/app/Components/AlertBox/AlertBox"; import { GetStudent } from "@/app/lib/getStudent"; + import "@/app/globals.css"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; + success?: string; + error?: string; }>; -}) { +}) { const params = await props.searchParams; - const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; + const numAcount = params?.numAcount ? params.numAcount : null; + const showSuccess = params?.success ? parseInt(params.success) : null; + let showError = params?.error ? params.error : null; let student: any = null; - let error: string | null = null; if (numAcount) { - const result = await GetStudent(numAcount); + const result = await GetStudent(parseInt(numAcount)); if (result.error) { - error = result.error; + showError = "Alumno no encontrado" } else { student = result; } @@ -30,10 +33,16 @@ export default async function Page(props: { return (
    - {error && } + {showError && ( + + )} + + {showSuccess && ( + + )}

    IMPRESIONES Y PLOTEO

    - + {student ? ( <> diff --git a/app/Components/AlertBox/AlertBox.tsx b/app/Components/AlertBox/AlertBox.tsx index 1711910..c9181a2 100644 --- a/app/Components/AlertBox/AlertBox.tsx +++ b/app/Components/AlertBox/AlertBox.tsx @@ -4,7 +4,7 @@ import { useEffect, useState } from "react"; import "./AlertBox.css"; interface AlertBoxProps { - message: string; + message: string | null; type: "error" | "success"; duration?: number; } diff --git a/app/Components/FallingSquares/FallingSquares.tsx b/app/Components/FallingSquares/FallingSquares.tsx new file mode 100644 index 0000000..5ea9bc0 --- /dev/null +++ b/app/Components/FallingSquares/FallingSquares.tsx @@ -0,0 +1,12 @@ +import "./style.css" +export default function FallingSquares() { + return ( +
    + {Array.from({ length: 10 }).map((_, i) => ( +
    + ))} +
    + ); +} +//Chat +//IO \ No newline at end of file diff --git a/app/Components/FallingSquares/style.css b/app/Components/FallingSquares/style.css new file mode 100644 index 0000000..8c462da --- /dev/null +++ b/app/Components/FallingSquares/style.css @@ -0,0 +1,117 @@ +.falling-container { + position: absolute; + width: 100%; + height: 100vh; + overflow: hidden; + z-index: -1; +} + +.square { + position: absolute; + top: -100px; + opacity: 0.9; + animation: fall linear infinite; + border-radius: 6px; +} + +@keyframes fall { + 0% { + transform: translateY(0) rotate(0deg); + } + 100% { + transform: translateY(110vh) rotate(1080deg); + } +} + +.square:nth-child(1) { + left: 10%; + width: 40px; + height: 40px; + background: linear-gradient(45deg, #ff7eb3, #ff758c); + animation-duration: 4s; + animation-delay: 0s; +} +.square:nth-child(2) { + left: 25%; + width: 60px; + height: 60px; + background: linear-gradient(45deg, #43cea2, #185a9d); + animation-duration: 6s; + animation-delay: 2s; +} +.square:nth-child(3) { + left: 40%; + width: 50px; + height: 50px; + background: linear-gradient(45deg, #f7971e, #ffd200); + animation-duration: 5s; + animation-delay: 1s; +} +.square:nth-child(4) { + left: 55%; + width: 70px; + height: 70px; + background: linear-gradient(45deg, #7f00ff, #e100ff); + animation-duration: 7s; + animation-delay: 3s; +} +.square:nth-child(5) { + left: 70%; + width: 45px; + height: 45px; + background: linear-gradient(45deg, #00c6ff, #0072ff); + animation-duration: 4.5s; + animation-delay: 1.5s; +} +.square:nth-child(6) { + left: 85%; + width: 55px; + height: 55px; + background: linear-gradient(45deg, #f953c6, #b91d73); + animation-duration: 6.5s; + animation-delay: 2.5s; +} +.square:nth-child(7) { + left: 15%; + width: 65px; + height: 65px; + background: linear-gradient(45deg, #11998e, #38ef7d); + animation-duration: 5.5s; + animation-delay: 1.2s; +} +.square:nth-child(8) { + left: 35%; + width: 40px; + height: 40px; + background: linear-gradient(45deg, #ff4e50, #f9d423); + animation-duration: 7.5s; + animation-delay: 0.5s; +} +.square:nth-child(9) { + left: 60%; + width: 75px; + height: 75px; + background: linear-gradient(45deg, #00b09b, #96c93d); + animation-duration: 4.2s; + animation-delay: 2.8s; +} +.square:nth-child(10) { + left: 80%; + width: 28px; + height: 28px; + background: linear-gradient(45deg, #ff9966, #ff5e62); + animation-duration: 6.8s; + animation-delay: 1.8s; +} + +@media (min-width: 768px) { + .square { + animation: fall linear infinite; + } +} + +@media (max-width: 767px) { + .square { + animation: none; + } +} diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index ed38e5b..4a1b5e4 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -1,9 +1,8 @@ "use client"; +import Cookies from "js-cookie"; import { useState } from "react"; import { useRouter } from "next/navigation"; -import Cookies from "js-cookie"; -import AlertBox from "../AlertBox/AlertBox"; import { PostImpressions } from "@/app/lib/postImpressions"; import "./Impressions.css"; @@ -21,7 +20,6 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { const [pages, setPages] = useState(""); const [cost, setCost] = useState(""); - const [error, setError] = useState(""); const router = useRouter(); const handleLogout = () => { @@ -31,37 +29,46 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { }; const handlePayment = async () => { - setError(""); if (!numAcount) { - setError("Error busca denuevo al estudiante"); + router.push( + `/Impresiones?numAcount=${numAcount}&error=Error busca denuevo al estudiante` + ); return; } if (!pages) { - setError("Ingresa el numero de hojas a imprimir"); + router.push( + `/Impresiones?numAcount=${numAcount}&error=Ingresa el numero de hojas a imprimir` + ); return; } if (!cost) { - setError("Selecciona un costo"); + router.push( + `/Impresiones?numAcount=${numAcount}&error=Selecciona un costo` + ); return; } const result = await PostImpressions({ - id_cuenta:numAcount, - numero_hojas : parseInt(pages), + id_cuenta: numAcount, + numero_hojas: parseInt(pages), monto: parseInt(cost) * parseInt(pages), }); if (result.error) { if (result.error === "Token inválido") handleLogout(); - else setError(result.error); + else { + router.push( + `/Impresiones?numAcount=${numAcount}&error=${result.error}` + ); + } return; } setPages(""); - setCost("") + setCost(""); }; return ( @@ -102,15 +109,15 @@ function Impressions({ costs, numAcount }: ImpressionsProps) {
    - +
    - - {error && }
    diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 0d19218..d5eb571 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -1,8 +1,8 @@ "use client"; -import AlertBox from "../AlertBox/AlertBox"; + import { useState } from "react"; import { PostReceipt } from "@/app/lib/postReceipt"; -import Cookies from "js-cookie"; +import { useRouter } from "next/navigation"; import "./Receipt.css"; @@ -11,13 +11,12 @@ interface ReceiptsProps { } function Receipt({ numAcount }: ReceiptsProps) { + const router = useRouter(); + const [folio, setFolio] = useState(""); const [amount, setAmount] = useState(""); const [date, setDate] = useState(""); - const [error, setError] = useState(""); - const [alert, setAlert] = useState(""); - //restrict this month// const day = new Date(); const year = day.getFullYear(); @@ -28,33 +27,50 @@ function Receipt({ numAcount }: ReceiptsProps) { const maxFecha = new Date(year, month, today).toISOString().split("T")[0]; //restrict this month// - const handleSaveReceipt = () => { + const handleSaveReceipt = async () => { if (!numAcount) { - setError("Error busca denuevo al estudiante"); + router.push( + `/Impresiones?numAcount=${numAcount}&error=Error busca denuevo al estudiante` + ); return; } if (!folio) { - setError("Ingresa el folio del tiket"); + router.push( + `/Impresiones?numAcount=${numAcount}&error=Ingresa el folio del tiket` + ); return; } if (!amount) { - setError("coloca el monto a depositar"); + router.push( + `/Impresiones?numAcount=${numAcount}&error=coloca el monto a depositar` + ); return; } if (!date) { - setError("coloca la fecha"); + router.push(`/Impresiones?numAcount=${numAcount}&error=coloca la fecha`); return; } - PostReceipt({ - id_cuenta: numAcount, - folio_recibo: folio, - monto: Number(amount), - fecha_recibo: date, - }); + try { + await PostReceipt({ + id_cuenta: numAcount, + folio_recibo: folio, + monto: Number(amount), + fecha_recibo: date, + }); + + setFolio(""); + setAmount(""); + setDate(""); + + router.push(`/Impresiones?numAcount=${numAcount}&success=1`); + } catch (err: any) { + console.error(err); + router.push(`/Impresiones?numAcount=${numAcount}&error=${err}`); + } }; return ( @@ -96,8 +112,9 @@ function Receipt({ numAcount }: ReceiptsProps) { if (value === "" || numericValue <= 1000) { setAmount(value); } else { - setAlert(""); - setError("El monto no puede superar $1000.00"); + router.push( + `/Impresiones?numAcount=${numAcount}&error=El monto no puede superar $1000.00` + ); } } }} @@ -120,9 +137,6 @@ function Receipt({ numAcount }: ReceiptsProps) {
    - - {error && } - {alert && }
    diff --git a/app/Components/SearchUser/searchUser.tsx b/app/Components/SearchUser/searchUser.tsx index 6af7039..a04d080 100644 --- a/app/Components/SearchUser/searchUser.tsx +++ b/app/Components/SearchUser/searchUser.tsx @@ -1,21 +1,28 @@ 'use client' import { useRouter } from "next/navigation"; -import { useState } from "react"; +import { useEffect, useState } from "react"; interface urlProp{ urlBase:string + value:string|null } -function SearchUser(url:urlProp) { +function SearchUser(props:urlProp) { const [numAcount, setnumAcount] = useState(""); const router = useRouter(); + useEffect(() => { + if (props.value) { + setnumAcount(props.value); + } + }, [props.value]); + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (numAcount) { - router.push(`/${url.urlBase}?numAcount=${numAcount}`); + router.push(`/${props.urlBase}?numAcount=${numAcount}`); } }; diff --git a/app/Components/Wave/wave.module.css b/app/Components/Wave/wave.module.css index 70cc41f..3da39d6 100644 --- a/app/Components/Wave/wave.module.css +++ b/app/Components/Wave/wave.module.css @@ -51,5 +51,6 @@ } .wave { display: none; + animation: none; } } diff --git a/app/Components/Wave/wavesBack.tsx b/app/Components/Wave/wavesBack.tsx index c2e0d99..20ded08 100644 --- a/app/Components/Wave/wavesBack.tsx +++ b/app/Components/Wave/wavesBack.tsx @@ -10,3 +10,5 @@ export default function WavesBackground() {
    ); } +//Chat +//IO \ No newline at end of file diff --git a/app/globals.css b/app/globals.css index b4aec32..e6b8b5a 100644 --- a/app/globals.css +++ b/app/globals.css @@ -289,7 +289,7 @@ form { .toggleGroup { display: flex; - gap: 10px; + gap: 5px; background-color: #f3f4f6; border-radius: 6px; flex-wrap: wrap; @@ -304,7 +304,7 @@ form { border-radius: 4px; transition: background-color 0.3s, color 0.3s; font-weight: 500; - overflow-y: hidden; + overflow: hidden; max-height: 60px; } diff --git a/app/layout.tsx b/app/layout.tsx index 0981bf2..15d5c4d 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,6 +4,7 @@ import Header from "./Components/Header/Header"; import Footer from "./Components/Footer/Footer"; import WavesBackground from "./Components/Wave/wavesBack"; import "./globals.css"; +import FallingSquares from "./Components/FallingSquares/FallingSquares"; const poppins = Poppins({ variable: "--font-poppins", @@ -25,9 +26,10 @@ export default function RootLayout({ }>) { return ( - +
    + {children}
    diff --git a/app/not-found.tsx b/app/not-found.tsx index b517f8d..03e157a 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -12,7 +12,7 @@ export default function NotFound() { return (
    Página no encontrada diff --git a/middleware.ts b/middleware.ts index 3789498..0f47ec8 100644 --- a/middleware.ts +++ b/middleware.ts @@ -13,6 +13,23 @@ export function middleware(request: NextRequest) { } export const config = { - matcher: [] + matcher: [ + "/Reportes", + "/Monitor", + "/QuitarSancion", + "/Programas", + "/Mensajes", + "/Inscritos", + "/Inscripciones", + "/InformacionEquipo", + "/Impresiones", + "/CambiarPass", + "/BitacoraSanciones", + "/AsignacionMesas", + "/AsignacionEquipo", + "/Alta", + "/AgregarTiempo", + "/ActivosMantenimiento", + ], }; //IO From fa84d440dfb0f049f44124c2e9ded73dcba19724 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 22 Sep 2025 14:41:22 -0400 Subject: [PATCH 6/9] add color to barnavigation --- app/Components/BarNavigation/BarNavigation.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Components/BarNavigation/BarNavigation.css b/app/Components/BarNavigation/BarNavigation.css index 38de740..2eecd94 100644 --- a/app/Components/BarNavigation/BarNavigation.css +++ b/app/Components/BarNavigation/BarNavigation.css @@ -21,7 +21,7 @@ font-weight: bold; width: 100%; transition: background-color 0.3s ease; - font-size: 2rem; + font-size: 1.5rem; } .barNavigation li:hover { @@ -68,7 +68,7 @@ flex-direction: column; top: 100%; width: 100%; - background-color: rgba(0, 61, 121, 1); + background-color: rgb(1, 92, 184); transition: color 0.3s ease, opacity 0.3s ease; } From 106378eefe8cdf07b1460d339c69fbe4695b0a48 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 22 Sep 2025 13:27:42 -0600 Subject: [PATCH 7/9] add value to searchUser --- app/(private)/ActivosMantenimiento/page.tsx | 214 ++++++++++---------- app/(private)/AgregarTiempo/page.tsx | 20 +- app/(private)/AsignacionEquipo/page.tsx | 69 +++---- app/(private)/AsignacionMesas/page.tsx | 102 +++++----- app/(private)/BitacoraSanciones/page.tsx | 18 +- app/(private)/Impresiones/page.tsx | 11 +- app/(private)/Inscripciones/page.tsx | 19 +- app/(private)/QuitarSancion/page.tsx | 2 +- app/Components/Login/Login.tsx | 4 +- app/Components/Receipt/Receipt.tsx | 15 +- 10 files changed, 241 insertions(+), 233 deletions(-) diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index cd39ba2..7687c5b 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -3,7 +3,15 @@ import SearchUser from "@/app/Components/SearchUser/searchUser"; import Toggle from "@/app/Components/Toggle/Toggle"; import { useState } from "react"; -export default function Page() { +export default function Page(props: { + searchParams?: Promise<{ + numAcount: string; + success?: string; + error?: string; + }>; +}) { + const params = props.searchParams; + const [tiempo, setTiempo] = useState(""); const [selectedTable, setSelectedTable] = useState(null); @@ -11,115 +19,113 @@ export default function Page() {

    EQUIPOS ACTIVOS Y EN MANTENIMIENTO

    - - + + -
    - -
    - - + + +
    + + +
    + + + ), + }, + { + key: "Areas", + label: "Areas", + content: ( + <> +
    + +
    + + +
    + +
    - - - ), - }, - { - key: "Areas", - label: "Areas", - content: ( - <> -
    - -
    - -
    - - -
    + +
    +
    + + ), + }, + { + key: "Mesas", + label: "Liberar mesa", + content: ( + <> +
    + +
    + - +
    + +
    - - - ), - }, - { - key: "Mesas", - label: "Liberar mesa", - content: ( - <> -
    - -
    - -
    - - -
    - - -
    -
    - - ), - }, - ]} - /> + +
    + + + ), + }, + ]} + />
    ); } diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index 357d2ba..17b2ea5 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -5,32 +5,34 @@ import { GetStudent } from "@/app/lib/getStudent"; import "./addTime.css"; -export default async function Page(props:{ +export default async function Page(props: { searchParams?: Promise<{ - numAcount:string; - }> + numAcount: string; + }>; }) { - - const params =await props.searchParams; - const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; let student: any = null; if (numAcount) { - student = await GetStudent(numAcount); + student = await GetStudent(parseInt(numAcount)); } return (

    AGREGAR TIEMPO

    - + {student ? ( <>
    - +
    ) : ( diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 8fa7b35..f4160e9 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -1,50 +1,45 @@ "use client"; import SearchUser from "@/app/Components/SearchUser/searchUser"; import Toggle from "@/app/Components/Toggle/Toggle"; -import { useState } from "react"; -// Assuming you will create this new component export default function Page() { - const [tiempo, setTiempo] = useState(""); - const [selectedTable, setSelectedTable] = useState(null); - return (

    ASIGNACION DE EQUIPOS

    - - + + -
    - - ), - }, - { - key: "Liberar", - label: "Cancelar tiempo", - content: ( - <> -
    - - -
    - - - ), - }, - ]} - /> +
    + + ), + }, + { + key: "Liberar", + label: "Cancelar tiempo", + content: ( + <> +
    + + +
    + + + ), + }, + ]} + />
    ); } diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 9ce759f..7551292 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -2,68 +2,66 @@ import SearchUser from "@/app/Components/SearchUser/searchUser"; import Toggle from "@/app/Components/Toggle/Toggle"; import { useState } from "react"; -// Assuming you will create this new component export default function Page() { const [tiempo, setTiempo] = useState(""); - const [selectedTable, setSelectedTable] = useState(null); return (

    ASIGNACION DE MESAS

    - - + + -
    - -
    - - -
    -
    - - ), - }, - { - key: "Liberar", - label: "Liberar mesa", - content: ( - <> -
    - - +
    + +
    + +
    - - - ), - }, - ]} - /> + + + ), + }, + { + key: "Liberar", + label: "Liberar mesa", + content: ( + <> +
    + + +
    + + + ), + }, + ]} + />
    ); } diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index d9c8234..9fd15d8 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -8,16 +8,16 @@ import Information from "@/app/Components/Information/information"; import SearchUser from "@/app/Components/SearchUser/searchUser"; import { GetStudent } from "@/app/lib/getStudent"; -export default async function Page(props:{ +export default async function Page(props: { searchParams?: Promise<{ - numAcount:string; - }> + numAcount: string; + }>; }) { - const params =await props.searchParams; - const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; - let student: any = null; - let error: string | null = null; + let student: any = null; + let error: string | null = null; const [usuario_sanciones] = useState([ { @@ -177,8 +177,8 @@ export default async function Page(props:{ label: "Sanciones", content: ( <> - - + +
    diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 3da83c2..6aa21c2 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -25,7 +25,7 @@ export default async function Page(props: { const result = await GetStudent(parseInt(numAcount)); if (result.error) { - showError = "Alumno no encontrado" + showError = "Alumno no encontrado"; } else { student = result; } @@ -42,7 +42,7 @@ export default async function Page(props: { )}

    IMPRESIONES Y PLOTEO

    - + {student ? ( <> @@ -59,7 +59,12 @@ export default async function Page(props: { { key: "1", label: "Recibo", - content: , + content: ( + + ), }, { key: "2", diff --git a/app/(private)/Inscripciones/page.tsx b/app/(private)/Inscripciones/page.tsx index 2fac6cc..c14b5a4 100644 --- a/app/(private)/Inscripciones/page.tsx +++ b/app/(private)/Inscripciones/page.tsx @@ -7,19 +7,18 @@ import { GetStudent } from "@/app/lib/getStudent"; import "./inscriptions.css"; -export default async function Page(props:{ +export default async function Page(props: { searchParams?: Promise<{ - numAcount:string; - }> + numAcount: string; + }>; }) { - - const params =await props.searchParams; - const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; + const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; let student: any = null; let error: string | null = null; if (numAcount) { - const result = await GetStudent(numAcount); + const result = await GetStudent(parseInt(numAcount)); if (result.error) { error = result.error; @@ -32,7 +31,7 @@ export default async function Page(props:{

    INSCRIPCION

    - + {student ? ( <> @@ -45,7 +44,7 @@ export default async function Page(props:{ - + ) : ( @@ -54,4 +53,4 @@ export default async function Page(props:{
    ); } -//IO \ No newline at end of file +//IO diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index c97c635..e9efcc6 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -17,7 +17,7 @@ export default function Page() { return (

    Quitar Sanciones

    - +
    diff --git a/app/Components/Login/Login.tsx b/app/Components/Login/Login.tsx index c86b84d..1e66f2a 100644 --- a/app/Components/Login/Login.tsx +++ b/app/Components/Login/Login.tsx @@ -10,6 +10,7 @@ function Login() { const [user, setUser] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); + const [alert, setAlert] = useState(""); const router = useRouter(); @@ -28,7 +29,7 @@ function Login() { document.cookie = `token=${token}; path=/; SameSite=Strict`; document.cookie = `id_usuario=${id_usuario}; path=/; SameSite=Strict`; - setError("Inicio de sesión exitoso"); + setAlert("Inicio de sesión exitoso"); router.push("/Impresiones"); } }; @@ -71,6 +72,7 @@ function Login() { {error && } + {alert && } ); diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index d5eb571..67bc02b 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -7,10 +7,11 @@ import { useRouter } from "next/navigation"; import "./Receipt.css"; interface ReceiptsProps { + urlBase:string; numAcount: number | null; } -function Receipt({ numAcount }: ReceiptsProps) { +function Receipt({urlBase , numAcount }: ReceiptsProps) { const router = useRouter(); const [folio, setFolio] = useState(""); @@ -30,27 +31,27 @@ function Receipt({ numAcount }: ReceiptsProps) { const handleSaveReceipt = async () => { if (!numAcount) { router.push( - `/Impresiones?numAcount=${numAcount}&error=Error busca denuevo al estudiante` + `/${urlBase}?numAcount=${numAcount}&error=Error busca denuevo al estudiante` ); return; } if (!folio) { router.push( - `/Impresiones?numAcount=${numAcount}&error=Ingresa el folio del tiket` + `/${urlBase}?numAcount=${numAcount}&error=Ingresa el folio del tiket` ); return; } if (!amount) { router.push( - `/Impresiones?numAcount=${numAcount}&error=coloca el monto a depositar` + `/${urlBase}?numAcount=${numAcount}&error=coloca el monto a depositar` ); return; } if (!date) { - router.push(`/Impresiones?numAcount=${numAcount}&error=coloca la fecha`); + router.push(`/${urlBase}?numAcount=${numAcount}&error=coloca la fecha`); return; } @@ -66,10 +67,10 @@ function Receipt({ numAcount }: ReceiptsProps) { setAmount(""); setDate(""); - router.push(`/Impresiones?numAcount=${numAcount}&success=1`); + router.push(`/${urlBase}?numAcount=${numAcount}&success=1`); } catch (err: any) { console.error(err); - router.push(`/Impresiones?numAcount=${numAcount}&error=${err}`); + router.push(`/${urlBase}?numAcount=${numAcount}&error=${err}`); } }; From f39ba8e1998a160729106c72f9b26e42bcade85c Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 22 Sep 2025 14:53:19 -0600 Subject: [PATCH 8/9] new structure --- app/(private)/ActivosMantenimiento/page.tsx | 1 - app/Components/AlertBox/AlertBox.tsx | 8 ++++++-- app/Components/Logout/Logout.tsx | 9 ++++++--- app/Components/Receipt/Receipt.tsx | 20 +++++++++---------- .../Wave}/FallingSquares/FallingSquares.tsx | 0 .../Wave}/FallingSquares/style.css | 0 .../{ => visual}/Wave/wave.module.css | 0 .../{ => visual}/Wave/wavesBack.tsx | 0 app/layout.tsx | 10 +++++----- app/lib/apiClient.ts | 2 +- app/lib/config.ts | 1 + app/lib/getStudent.ts | 6 ++++-- app/lib/login.ts | 1 + app/lib/postImpressions.ts | 1 + app/lib/postReceipt.ts | 2 +- 15 files changed, 36 insertions(+), 25 deletions(-) rename app/Components/{ => visual/Wave}/FallingSquares/FallingSquares.tsx (100%) rename app/Components/{ => visual/Wave}/FallingSquares/style.css (100%) rename app/Components/{ => visual}/Wave/wave.module.css (100%) rename app/Components/{ => visual}/Wave/wavesBack.tsx (100%) diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 7687c5b..e6cdf48 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -13,7 +13,6 @@ export default function Page(props: { const params = props.searchParams; const [tiempo, setTiempo] = useState(""); - const [selectedTable, setSelectedTable] = useState(null); return (
    diff --git a/app/Components/AlertBox/AlertBox.tsx b/app/Components/AlertBox/AlertBox.tsx index c9181a2..e8863ea 100644 --- a/app/Components/AlertBox/AlertBox.tsx +++ b/app/Components/AlertBox/AlertBox.tsx @@ -1,4 +1,4 @@ -'use client' +"use client"; import { useEffect, useState } from "react"; import "./AlertBox.css"; @@ -9,7 +9,11 @@ interface AlertBoxProps { duration?: number; } -export default function AlertBox({ message, type, duration = 6000 }: AlertBoxProps) { +export default function AlertBox({ + message, + type, + duration = 6000, +}: AlertBoxProps) { const [visible, setVisible] = useState(false); const [text, setText] = useState(""); diff --git a/app/Components/Logout/Logout.tsx b/app/Components/Logout/Logout.tsx index 8fa3fc0..3f8ab15 100644 --- a/app/Components/Logout/Logout.tsx +++ b/app/Components/Logout/Logout.tsx @@ -14,8 +14,11 @@ export default function Logout() { }; return ( - + <> +

    + + ); } diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 67bc02b..96d81a5 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -7,11 +7,11 @@ import { useRouter } from "next/navigation"; import "./Receipt.css"; interface ReceiptsProps { - urlBase:string; + urlBase: string; numAcount: number | null; } -function Receipt({urlBase , numAcount }: ReceiptsProps) { +function Receipt({ urlBase, numAcount }: ReceiptsProps) { const router = useRouter(); const [folio, setFolio] = useState(""); @@ -31,27 +31,27 @@ function Receipt({urlBase , numAcount }: ReceiptsProps) { const handleSaveReceipt = async () => { if (!numAcount) { router.push( - `/${urlBase}?numAcount=${numAcount}&error=Error busca denuevo al estudiante` + `${urlBase}?numAcount=${numAcount}&error=Error busca denuevo al estudiante` ); return; } if (!folio) { router.push( - `/${urlBase}?numAcount=${numAcount}&error=Ingresa el folio del tiket` + `${urlBase}?numAcount=${numAcount}&error=Ingresa el folio del tiket` ); return; } if (!amount) { router.push( - `/${urlBase}?numAcount=${numAcount}&error=coloca el monto a depositar` + `${urlBase}?numAcount=${numAcount}&error=coloca el monto a depositar` ); return; } if (!date) { - router.push(`/${urlBase}?numAcount=${numAcount}&error=coloca la fecha`); + router.push(`${urlBase}?numAcount=${numAcount}&error=coloca la fecha`); return; } @@ -67,10 +67,10 @@ function Receipt({urlBase , numAcount }: ReceiptsProps) { setAmount(""); setDate(""); - router.push(`/${urlBase}?numAcount=${numAcount}&success=1`); + router.push(`${urlBase}?numAcount=${numAcount}&success=1`); } catch (err: any) { console.error(err); - router.push(`/${urlBase}?numAcount=${numAcount}&error=${err}`); + router.push(`${urlBase}?numAcount=${numAcount}&error=${err}`); } }; @@ -87,8 +87,8 @@ function Receipt({urlBase , numAcount }: ReceiptsProps) { { - const value = e.target.value; + onChange={(error) => { + const value = error.target.value; if (/^\d*$/.test(value)) { setFolio(value); } diff --git a/app/Components/FallingSquares/FallingSquares.tsx b/app/Components/visual/Wave/FallingSquares/FallingSquares.tsx similarity index 100% rename from app/Components/FallingSquares/FallingSquares.tsx rename to app/Components/visual/Wave/FallingSquares/FallingSquares.tsx diff --git a/app/Components/FallingSquares/style.css b/app/Components/visual/Wave/FallingSquares/style.css similarity index 100% rename from app/Components/FallingSquares/style.css rename to app/Components/visual/Wave/FallingSquares/style.css diff --git a/app/Components/Wave/wave.module.css b/app/Components/visual/Wave/wave.module.css similarity index 100% rename from app/Components/Wave/wave.module.css rename to app/Components/visual/Wave/wave.module.css diff --git a/app/Components/Wave/wavesBack.tsx b/app/Components/visual/Wave/wavesBack.tsx similarity index 100% rename from app/Components/Wave/wavesBack.tsx rename to app/Components/visual/Wave/wavesBack.tsx diff --git a/app/layout.tsx b/app/layout.tsx index 15d5c4d..c4e3b34 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,9 +2,9 @@ import type { Metadata } from "next"; import { Poppins } from "next/font/google"; import Header from "./Components/Header/Header"; import Footer from "./Components/Footer/Footer"; -import WavesBackground from "./Components/Wave/wavesBack"; -import "./globals.css"; -import FallingSquares from "./Components/FallingSquares/FallingSquares"; +import WavesBackground from "./Components/visual/Wave/wavesBack"; +import FallingSquares from "./Components/visual/Wave/FallingSquares/FallingSquares"; +import "./globals.css"; const poppins = Poppins({ variable: "--font-poppins", @@ -29,7 +29,7 @@ export default function RootLayout({
    - + {children}
    @@ -38,4 +38,4 @@ export default function RootLayout({ ); } -//IO \ No newline at end of file +//IO diff --git a/app/lib/apiClient.ts b/app/lib/apiClient.ts index 5fd0104..0ffd831 100644 --- a/app/lib/apiClient.ts +++ b/app/lib/apiClient.ts @@ -11,7 +11,6 @@ const apiClient = axios.create({ apiClient.interceptors.request.use((config) => { const token = Cookies.get("token"); - console.log(token) if (token) { if (config.headers && "set" in config.headers) { config.headers.set("Authorization", `Bearer ${token}`); @@ -21,3 +20,4 @@ apiClient.interceptors.request.use((config) => { }); export default apiClient; +//IO diff --git a/app/lib/config.ts b/app/lib/config.ts index 8e4f59b..365b865 100644 --- a/app/lib/config.ts +++ b/app/lib/config.ts @@ -1,3 +1,4 @@ export const envConfig = { apiUrl: process.env.NEXT_PUBLIC_API_URL, }; +//IO diff --git a/app/lib/getStudent.ts b/app/lib/getStudent.ts index 5e0f4f5..4107a84 100644 --- a/app/lib/getStudent.ts +++ b/app/lib/getStudent.ts @@ -3,8 +3,9 @@ import { envConfig } from "./config"; export async function GetStudent(numAcount: number) { try { - const response = await axios.get(`${envConfig.apiUrl}/student/${numAcount}`); - console.log(response.data) + const response = await axios.get( + `${envConfig.apiUrl}/student/${numAcount}` + ); return response.data; } catch (error: any) { const msg = @@ -14,3 +15,4 @@ export async function GetStudent(numAcount: number) { return { error: msg }; } } +//IO diff --git a/app/lib/login.ts b/app/lib/login.ts index b32f0db..5cba2a7 100644 --- a/app/lib/login.ts +++ b/app/lib/login.ts @@ -16,3 +16,4 @@ export async function loginUser(usuario: string, password: string) { return { error: msg }; } } +//IO diff --git a/app/lib/postImpressions.ts b/app/lib/postImpressions.ts index 5cc2a5c..87224e1 100644 --- a/app/lib/postImpressions.ts +++ b/app/lib/postImpressions.ts @@ -12,3 +12,4 @@ export async function PostImpressions(data: any) { return { error: msg }; } } +//IO diff --git a/app/lib/postReceipt.ts b/app/lib/postReceipt.ts index 6c39e74..099ccd4 100644 --- a/app/lib/postReceipt.ts +++ b/app/lib/postReceipt.ts @@ -3,7 +3,6 @@ import apiClient from "./apiClient"; export async function PostReceipt(data: any) { try { const response = await apiClient.post("/operations/receipt", data); - console.log(response.data); return response.data; } catch (error: any) { const msg = @@ -13,3 +12,4 @@ export async function PostReceipt(data: any) { return { error: msg }; } } +//IO From 6f1cdb9c6a117a2a251256ad7f535d4de21e720a Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 22 Sep 2025 14:58:23 -0600 Subject: [PATCH 9/9] fixed fallingsquare --- .../visual/{Wave => }/FallingSquares/FallingSquares.tsx | 0 app/Components/visual/{Wave => }/FallingSquares/style.css | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename app/Components/visual/{Wave => }/FallingSquares/FallingSquares.tsx (100%) rename app/Components/visual/{Wave => }/FallingSquares/style.css (100%) diff --git a/app/Components/visual/Wave/FallingSquares/FallingSquares.tsx b/app/Components/visual/FallingSquares/FallingSquares.tsx similarity index 100% rename from app/Components/visual/Wave/FallingSquares/FallingSquares.tsx rename to app/Components/visual/FallingSquares/FallingSquares.tsx diff --git a/app/Components/visual/Wave/FallingSquares/style.css b/app/Components/visual/FallingSquares/style.css similarity index 100% rename from app/Components/visual/Wave/FallingSquares/style.css rename to app/Components/visual/FallingSquares/style.css