import { toast, ToastContainer, Bounce } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; /** * 🔧 Ezt csak egyszer kell betenni az App.jsx-be! * = az a komponens, ami kirendereli a toastokat */ export const ToastConfig = () => ( ); /** * 🦄 Alapértelmezett toast üzenet (semleges) * notify("Üzenet szövege") */ export const notify = (message) => { toast(message, { position: "bottom-right", autoClose: 5000, hideProgressBar: false, closeOnClick: false, pauseOnHover: true, draggable: true, theme: "light", transition: Bounce, }); }; /** * ✅ Sikeres művelethez * notifySuccess("Sikeres mentés!") */ export const notifySuccess = (message) => { toast.success(message, { position: "bottom-right", autoClose: 4000, theme: "light", transition: Bounce, }); }; /** * ❌ Hibás művelethez * notifyError("Hiba történt a mentés során!") */ export const notifyError = (message) => { toast.error(message, { position: "bottom-right", autoClose: 5000, theme: "light", transition: Bounce, }); }; /** * ℹ️ Információs üzenethez * notifyInfo("Friss adatok betöltve!") */ export const notifyInfo = (message) => { toast.info(message, { position: "bottom-right", autoClose: 4000, theme: "light", transition: Bounce, }); }; /** * ⚠️ Figyelmeztetéshez * notifyWarning("Figyelem! Nem mentett módosítások vannak!") */ export const notifyWarning = (message) => { toast.warn(message, { position: "bottom-right", autoClose: 4000, theme: "light", transition: Bounce, }); }; // import React, { useState } from "react"; // import { notifyWarning } from "../../components/Toastify/toastifyServices"; // function AuthLogin() { // const [email, setEmail] = useState(""); // const [password, setPassword] = useState(""); // const handleLogin = async (e) => { // e.preventDefault(); // // Példa jelszó ellenőrzés logikára: // if (password !== "titkosjelszo123") { // notifyWarning("⚠️ Hibás jelszó! Kérlek próbáld újra."); // return; // } // // Ha jó a jelszó: // notifySuccess("✅ Sikeres bejelentkezés!"); // }; // return ( //
// setEmail(e.target.value)} // /> // setPassword(e.target.value)} // /> // //
// ); // } // export default AuthLogin; // meghivas // import { toast } from "react-toastify"; // // 🔔 Alap toast // export const notify = (msg) => toast(msg); // // ✅ Sikeres üzenet // export const notifySuccess = (msg) => toast.success(msg); // // ⚠️ Figyelmeztetés // export const notifyWarning = (msg) => toast.warning(msg); // // ❌ Hiba // export const notifyError = (msg) => toast.error(msg); // // ℹ️ Információ // export const notifyInfo = (msg) => toast.info(msg); // hasznalat // import { notifyWarning } from "../../components/Toastify/toastifyServices"; // if (password !== "titkos") { // notifyWarning("⚠️ Hibás jelszó!"); // }