diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index c7a081d..357d2ba 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -5,15 +5,18 @@ 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 props.searchParams; + const numAcount = params?.numAcount ? parseInt(params.numAcount) : null; - const numAccount = searchParams?.numAccount - ? Number(searchParams.numAccount) - : null; - let student: any = null; - if (numAccount) { - student = await GetStudent(numAccount); + if (numAcount) { + student = await GetStudent(numAcount); } return ( @@ -27,7 +30,7 @@ export default async function Page({ searchParams }: any) {
- +
) : ( diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 66b5906..d9c8234 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 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 b72beac..715ce2b 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -8,14 +8,18 @@ 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 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; @@ -46,7 +50,7 @@ export default async function Page({ searchParams }: any) { { key: "1", label: "Recibo", - content: , + content: , }, { key: "2", @@ -54,7 +58,7 @@ export default async function Page({ searchParams }: any) { content: ( ), }, @@ -73,7 +77,7 @@ export default async function Page({ searchParams }: any) { { value: 12 }, { value: 14 }, ]} - numAccount={student.id_cuenta} + numAcount={student.id_cuenta} /> ), }, @@ -101,7 +105,7 @@ export default async function Page({ searchParams }: any) { { value: 150 }, { value: 200 }, ]} - numAccount={student.id_cuenta} + numAcount={student.id_cuenta} /> ), }, @@ -111,7 +115,7 @@ export default async function Page({ searchParams }: any) { content: ( ), }, diff --git a/app/(private)/Inscripciones/page.tsx b/app/(private)/Inscripciones/page.tsx index da37631..2fac6cc 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,14 +5,21 @@ 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 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; @@ -40,7 +45,7 @@ export default async function Page({ searchParams }: any) { - + ) : ( @@ -49,3 +54,4 @@ export default async function Page({ searchParams }: any) { ); } +//IO \ No newline at end of file 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/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/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/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/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/layout.tsx b/app/layout.tsx index e207c3f..0981bf2 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -25,7 +25,7 @@ export default function RootLayout({ }>) { return ( - +
    {children} 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) { 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