add react-toastify for notifications and implement weather fetching functionality
This commit is contained in:
17
frontend/src/utils/toastify.ts
Normal file
17
frontend/src/utils/toastify.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
};
|
Reference in New Issue
Block a user