new structure

This commit is contained in:
2025-09-22 14:53:19 -06:00
parent c68e8e0b17
commit f39ba8e199
15 changed files with 36 additions and 25 deletions
@@ -13,7 +13,6 @@ export default function Page(props: {
const params = props.searchParams;
const [tiempo, setTiempo] = useState("");
const [selectedTable, setSelectedTable] = useState(null);
return (
<section className="containerSection">
+6 -2
View File
@@ -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("");
+6 -3
View File
@@ -14,8 +14,11 @@ export default function Logout() {
};
return (
<button onClick={handleLogout} className="button button-logout">
Cerrar sesión
</button>
<>
<h4></h4>
<button onClick={handleLogout} className="button button-logout">
Cerrar sesión
</button>
</>
);
}
+10 -10
View File
@@ -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) {
<input
type="text"
value={folio}
onChange={(e) => {
const value = e.target.value;
onChange={(error) => {
const value = error.target.value;
if (/^\d*$/.test(value)) {
setFolio(value);
}
+5 -5
View File
@@ -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({
<body className={poppins.variable}>
<Header />
<main>
<FallingSquares/>
<FallingSquares />
{children}
<WavesBackground />
</main>
@@ -38,4 +38,4 @@ export default function RootLayout({
</html>
);
}
//IO
//IO
+1 -1
View File
@@ -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
+1
View File
@@ -1,3 +1,4 @@
export const envConfig = {
apiUrl: process.env.NEXT_PUBLIC_API_URL,
};
//IO
+4 -2
View File
@@ -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
+1
View File
@@ -16,3 +16,4 @@ export async function loginUser(usuario: string, password: string) {
return { error: msg };
}
}
//IO
+1
View File
@@ -12,3 +12,4 @@ export async function PostImpressions(data: any) {
return { error: msg };
}
}
//IO
+1 -1
View File
@@ -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