modal accept with notifications

This commit is contained in:
2023-07-14 03:03:49 +03:00
parent 001920a840
commit 7c7ea86c8c
9 changed files with 155 additions and 112 deletions

View File

@ -1,15 +1,15 @@
import { useDispatch } from "react-redux";
import { setNotification, closeNotification } from "../redux/outstaffingSlice";
import { closeNotification, setNotification } from "../redux/outstaffingSlice";
export const useNotification = () => {
const dispatch = useDispatch();
const dispatch = useDispatch();
const showNotification = (notification) => {
dispatch(setNotification(notification))
setTimeout(() => {
dispatch(closeNotification())
}, 2500)
}
return { showNotification }
const showNotification = (notification) => {
dispatch(setNotification(notification));
setTimeout(() => {
dispatch(closeNotification());
}, 2500);
};
return { showNotification };
};