addded toast badge function

Currently, after every Event, you have to reload the page manually!!!
This commit is contained in:
2025-07-24 15:21:57 +02:00
parent b69b446e3d
commit 6da6693c17
4 changed files with 24 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
import Cookies from "js-cookie";
import { toast, type ToastOptions } from "react-toastify";
export const greeting = () => {
return Cookies.get("name") ?? "Login";
@@ -50,3 +51,19 @@ export const setDarkTheme = () => {
document.body.classList.add("dark");
Cookies.set("theme", "dark", { expires: 365 });
};
export type ToastType = "success" | "error" | "info" | "warning";
export const myToast = (message: string, msgType: ToastType) => {
let config: ToastOptions = {
position: "top-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "dark",
};
toast[msgType](message, config);
};