Files
weather-app/frontend/src/utils/toastify.ts
theis.gaedigk e505d9b0e8 fix: increase autoClose duration for Toast notifications to improve user experience
refactor: enhance error handling in fetchWeather function with detailed console messages
2025-07-30 11:23:42 +02:00

18 lines
456 B
TypeScript

import { toast, type ToastOptions } from "react-toastify";
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);
};