Modified Alerts
This commit is contained in:
@@ -11,7 +11,7 @@ export default function Page() {
|
|||||||
<h1 className="title">ALTA</h1>
|
<h1 className="title">ALTA</h1>
|
||||||
|
|
||||||
<StepNavigator totalSteps={2} onFinish={() => console.log()}>
|
<StepNavigator totalSteps={2} onFinish={() => console.log()}>
|
||||||
<form className="containerForm">
|
<form className="containerForm gap">
|
||||||
<label className="label">No.Cuenta</label>
|
<label className="label">No.Cuenta</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@@ -44,7 +44,7 @@ export default function Page() {
|
|||||||
placeholder="Coloca el apellido materno"
|
placeholder="Coloca el apellido materno"
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
<form>
|
<form className="gap">
|
||||||
<label className="label">Email</label>
|
<label className="label">Email</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import AlertBox from "@/app/Components/AlertBox/AlertBox";
|
|||||||
import { GetStudent } from "@/app/lib/getStudent";
|
import { GetStudent } from "@/app/lib/getStudent";
|
||||||
|
|
||||||
import "@/app/globals.css";
|
import "@/app/globals.css";
|
||||||
|
|
||||||
export default async function Page(props: {
|
export default async function Page(props: {
|
||||||
searchParams?: Promise<{
|
searchParams?: Promise<{
|
||||||
numAcount: string;
|
numAcount: string;
|
||||||
@@ -34,7 +33,9 @@ export default async function Page(props: {
|
|||||||
return (
|
return (
|
||||||
<section className="containerSection">
|
<section className="containerSection">
|
||||||
{showError && (
|
{showError && (
|
||||||
<AlertBox key={Date.now()} message={showError} type="error" />
|
<>
|
||||||
|
<AlertBox key={Date.now()} message={showError} type="error" />
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{showSuccess && (
|
{showSuccess && (
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export default function Page() {
|
|||||||
<div className="margin">
|
<div className="margin">
|
||||||
<button className="button buttonSearch">Guardar</button>
|
<button className="button buttonSearch">Guardar</button>
|
||||||
<button
|
<button
|
||||||
className={`button buttonSearch ${styleprograms.button}`}
|
className={`button buttonCancel ${styleprograms.button}`}
|
||||||
onClick={handleCancelar}
|
onClick={handleCancelar}
|
||||||
>
|
>
|
||||||
Cancelar
|
Cancelar
|
||||||
@@ -79,7 +79,7 @@ export default function Page() {
|
|||||||
<div className="margin">
|
<div className="margin">
|
||||||
<button className="button buttonSearch">Insertar</button>
|
<button className="button buttonSearch">Insertar</button>
|
||||||
<button
|
<button
|
||||||
className={`button buttonSearch ${styleprograms.button}`}
|
className={`button buttonCancel ${styleprograms.button}`}
|
||||||
onClick={handleCancelar}
|
onClick={handleCancelar}
|
||||||
>
|
>
|
||||||
Cancelar
|
Cancelar
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* Animaciones */
|
|
||||||
@keyframes slideInLeft {
|
@keyframes slideInLeft {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default function ChangePassword() {
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="button buttonSearch"
|
className="button buttonCancel"
|
||||||
style={{ maxWidth: "100%", width: "100%" }}
|
style={{ maxWidth: "100%", width: "100%" }}
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
interface ClearParamsProps {
|
||||||
|
paramsToClear: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function ClearParams({ paramsToClear }: ClearParamsProps) {
|
||||||
|
useEffect(() => {
|
||||||
|
const url = new URL(window.location.href);
|
||||||
|
let changed = false;
|
||||||
|
|
||||||
|
paramsToClear.forEach((param) => {
|
||||||
|
if (url.searchParams.has(param)) {
|
||||||
|
url.searchParams.delete(param);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
window.history.replaceState({}, "", url.toString());
|
||||||
|
}
|
||||||
|
}, [paramsToClear]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import AlertBox from "@/app/Components/AlertBox/AlertBox";
|
||||||
|
import ClearParams from "@/app/Components/ClearParams/ClearParams";
|
||||||
|
|
||||||
|
export default function GlobalAlert() {
|
||||||
|
const [showSuccess, setShowSuccess] = useState<string | null>(null);
|
||||||
|
const [showError, setShowError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const url = new URL(window.location.href);
|
||||||
|
const success = url.searchParams.get("success");
|
||||||
|
const error = url.searchParams.get("error");
|
||||||
|
|
||||||
|
if (success) setShowSuccess(success);
|
||||||
|
if (error) setShowError(error);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className="containerAlerts">
|
||||||
|
{showError && (
|
||||||
|
<>
|
||||||
|
<AlertBox key={Date.now()} message={showError} type="error" />
|
||||||
|
<ClearParams paramsToClear={["error"]} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{showSuccess && (
|
||||||
|
<>
|
||||||
|
<AlertBox key={Date.now()} message={showSuccess} type="success" />
|
||||||
|
<ClearParams paramsToClear={["success"]} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -26,6 +26,10 @@ body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: auto 1fr;
|
grid-template-columns: auto 1fr;
|
||||||
@@ -215,6 +219,14 @@ button {
|
|||||||
background-color: #15803d;
|
background-color: #15803d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttonCancel {
|
||||||
|
background-color: #d32f2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonCancel:hover {
|
||||||
|
background-color: #d12020;
|
||||||
|
}
|
||||||
|
|
||||||
.absoluteButton {
|
.absoluteButton {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1rem;
|
bottom: 1rem;
|
||||||
@@ -406,6 +418,12 @@ table tr {
|
|||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.containerAlert {
|
||||||
|
position: absolute;
|
||||||
|
background-color: #003e79;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 1330px) {
|
@media (max-width: 1330px) {
|
||||||
.mainContainer {
|
.mainContainer {
|
||||||
grid-template-rows: 60px 1fr;
|
grid-template-rows: 60px 1fr;
|
||||||
|
|||||||
+1
-2
@@ -2,10 +2,9 @@ import type { Metadata } from "next";
|
|||||||
import { Poppins } from "next/font/google";
|
import { Poppins } from "next/font/google";
|
||||||
import Header from "./Components/Header/Header";
|
import Header from "./Components/Header/Header";
|
||||||
import Footer from "./Components/Footer/Footer";
|
import Footer from "./Components/Footer/Footer";
|
||||||
import FallingSquares from "./Components/visual/FallingSquares/FallingSquares";
|
|
||||||
import WavesBackground from "./Components/visual/Wave/wavesBack";
|
|
||||||
|
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
import GlobalAlert from "./Components/visual/GlobalAlert";
|
||||||
|
|
||||||
const poppins = Poppins({
|
const poppins = Poppins({
|
||||||
variable: "--font-poppins",
|
variable: "--font-poppins",
|
||||||
|
|||||||
Reference in New Issue
Block a user