diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index b944840..df7fc96 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -38,17 +38,7 @@ export default async function Page(props: {
-
- - -
+
diff --git a/app/Components/Alta/registerAlta.tsx b/app/Components/Alta/registerAlta.tsx index 6e0aebf..e3e8089 100644 --- a/app/Components/Alta/registerAlta.tsx +++ b/app/Components/Alta/registerAlta.tsx @@ -1,8 +1,30 @@ "use client"; -import { useState } from "react"; +import axios from "axios"; +import { useEffect, useState } from "react"; export default function RegisterAlta() { + const [listMajor, setListMajor] = useState([]); const [major, setMajor] = useState(""); + + useEffect(() => { + const fetchCarreras = async () => { + try { + const response = await axios.get( + "https://venus.acatlan.unam.mx/asignacionTiempo_test/carrera" + ); + + const sortedCarreras = response.data.sort((a: any, b: any) => + a.carrera.localeCompare(b.carrera) + ); + + setListMajor(sortedCarreras); + } catch (error) { + console.error("Error al obtener carreras:", error); + } + }; + fetchCarreras(); + }, []); + return (
@@ -59,6 +81,11 @@ export default function RegisterAlta() {
diff --git a/app/Components/Global/selectArea.tsx b/app/Components/Global/selectArea.tsx new file mode 100644 index 0000000..37a9350 --- /dev/null +++ b/app/Components/Global/selectArea.tsx @@ -0,0 +1,33 @@ +import axios from "axios"; +import { useEffect, useState } from "react"; + +export default function selectArea() { + const [area, setArea] = useState([]); + + useEffect(() => { + const fetchArea = async () => { + const response = await axios.get( + "https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion" + ); + setArea(response.data); + }; + + fetchArea(); + }); + return ( + <> + + + + ); +} diff --git a/app/Components/Receipt/Receipt.css b/app/Components/Receipt/Receipt.css index e69de29..94a4965 100644 --- a/app/Components/Receipt/Receipt.css +++ b/app/Components/Receipt/Receipt.css @@ -0,0 +1,24 @@ +.groupInformation { + display: flex; + max-width: 500px; + min-width: 40px; + width: 100%; + justify-content: end; + gap: 10px; +} + +.informationButton { + text-align: center; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + border: 1px solid #cfcfcf; + background-color: #fff; + max-width: 40px; + min-width: 40px; +} + +.informationButton:hover { + border: 1px solid #cfcfcf; + background-color: #cfcfcf; +} diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index cf8f6bb..9d0d281 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -3,7 +3,7 @@ import toast from "react-hot-toast"; import { useState } from "react"; import { PostReceipt } from "@/app/lib/postReceipt"; -import { useParams, usePathname, useRouter } from "next/navigation"; +import { useRouter } from "next/navigation"; import "./Receipt.css"; @@ -13,8 +13,6 @@ interface ReceiptsProps { function Receipt({ numAcount }: ReceiptsProps) { const router = useRouter(); - const path = usePathname(); - console.log(path); const [folio, setFolio] = useState(""); const [amount, setAmount] = useState(""); @@ -80,19 +78,25 @@ function Receipt({ numAcount }: ReceiptsProps) {
- { - const value = error.target.value; - if (/^\d*$/.test(value) && value.length <= 7) { - setFolio(value); - } - }} - placeholder="Numero de tiket..." - inputMode="numeric" - pattern="[0-9]*" - /> +
+ { + const value = error.target.value; + if (/^\d*$/.test(value) && value.length <= 7) { + setFolio(value); + } + }} + placeholder="Numero de tiket..." + inputMode="numeric" + pattern="[0-9]*" + /> + +
diff --git a/app/Components/auth/ChangePassword/changePassword.tsx b/app/Components/auth/ChangePassword/changePassword.tsx index 1a47db6..7f4eac1 100644 --- a/app/Components/auth/ChangePassword/changePassword.tsx +++ b/app/Components/auth/ChangePassword/changePassword.tsx @@ -1,4 +1,5 @@ "use client"; +import axios from "axios"; import { useState } from "react"; export default function ChangePassword() { @@ -6,10 +7,14 @@ export default function ChangePassword() { const [newPass, setNewPass] = useState(""); const [confirmNewPass, setconfirmNewPass] = useState(""); - const handleChangePass = (e: React.FormEvent) => { + const handleChangePass = async (e: React.FormEvent) => { e.preventDefault; const data = { pass, newPass, confirmNewPass }; - console.log(data); + + await axios.post( + "https://venus.acatlan.unam.mx/asignacionTiempo_test/user/create", + data + ); }; return ( diff --git a/app/Components/layout/ToastProvider.tsx b/app/Components/layout/ToastProvider.tsx index 9cadd36..af3d64b 100644 --- a/app/Components/layout/ToastProvider.tsx +++ b/app/Components/layout/ToastProvider.tsx @@ -12,6 +12,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { style: { padding: "16px", fontSize: "16px", + maxWidth: "400px", }, error: { @@ -21,7 +22,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { backgroundColor: "#fee2e2dd", color: "#000000ff", fontWeight: "600", - padding:"1.5rem" + padding: "1.5rem", }, }, @@ -32,7 +33,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) { backgroundColor: "#d1fae5dd", color: "#000000ff", fontWeight: "600", - padding:"1.5rem" + padding: "1.5rem", }, }, }} diff --git a/app/globals.css b/app/globals.css index 136fc4e..f6675ee 100644 --- a/app/globals.css +++ b/app/globals.css @@ -88,11 +88,12 @@ footer p { .mainContainer { position: relative; display: grid; - grid-template-rows: 40px 1fr; + grid-template-rows: auto 1fr; align-items: center; justify-items: center; height: 100%; width: 100%; + background-color: #f9f9f9; } @keyframes fadeInUp { @@ -180,12 +181,12 @@ select { input:focus, select:focus { background-color: #f9f9f9; - outline:none; - box-shadow: 0px 0px 8px 2px rgba(0, 62, 121, 0.5); + outline: none; + box-shadow: 0px 0px 8px 2px rgba(0, 62, 121, 0.5); transition: all 0.2s ease-in-out; } -input[type="checkbox"]{ +input[type="checkbox"] { min-width: 3rem; } @@ -196,7 +197,7 @@ label { } button { - font-size: 2rem; + font-size: 1.5rem; padding: 1rem 1.75rem; border-radius: 4px; cursor: pointer; @@ -296,7 +297,7 @@ a { font-size: 3rem; font-weight: bold; text-align: start; - color:#bd8c01; + color: #bd8c01; border-bottom: 1px solid #cfcfcf; margin-bottom: 10px; } @@ -352,7 +353,7 @@ form { } .toggleButton.active { - font-weight: 700; + font-weight: 600; background-color: #e5e7eb; color: rgb(1, 92, 184); border-radius: 4px 4px 0 0; @@ -462,22 +463,6 @@ table tr { align-items: center; } - .img { - width: 100%; - } - - .img::after { - background: linear-gradient(to right, #f9f9f993, rgba(128, 128, 128, 0)); - } - - .img::before { - display: flex; - content: ""; - position: absolute; - inset: 0; - background: linear-gradient(to left, #f9f9f993, rgba(128, 128, 128, 0)); - } - .title { text-align: center; } @@ -563,7 +548,6 @@ table tr { } button { - font-size: 1.5rem; padding: 1rem 1.5rem; } diff --git a/app/lib/postReceipt.ts b/app/lib/postReceipt.ts index 099ccd4..dd9b6e1 100644 --- a/app/lib/postReceipt.ts +++ b/app/lib/postReceipt.ts @@ -9,7 +9,7 @@ export async function PostReceipt(data: any) { error.response?.data?.message || error.message || "Error desconocido al crear recibo"; - return { error: msg }; + throw new Error(msg); } } //IO