Changed from Alert to Toast to work well with mui v18

This commit is contained in:
Frikky
2023-08-17 03:16:43 +02:00
parent 1461d6ad6b
commit 99d1a96c63
36 changed files with 553 additions and 542 deletions
+6 -6
View File
@@ -42,7 +42,7 @@ import {
Lightbulb as LightbulbIcon,
} from "@mui/icons-material";
import { useAlert } from "react-alert";
//import { useAlert
import SearchField from '../components/Searchfield.jsx'
const hoverColor = "#f85a3e"
@@ -51,7 +51,7 @@ const hoverOutColor = "#e8eaf6"
const Header = props => {
const { globalUrl, setNotifications, notifications, isLoggedIn, removeCookie, homePage, userdata, serverside, } = props;
//const theme = useTheme();
const alert = useAlert()
//const alert = useAlert()
const [HomeHoverColor, setHomeHoverColor] = useState(hoverOutColor);
@@ -101,7 +101,7 @@ const { globalUrl, setNotifications, notifications, isLoggedIn, removeCookie, ho
setNotifications([])
handleClose()
} else {
alert.error("Failed dismissing notifications. Please try again later.")
toast("Failed dismissing notifications. Please try again later.")
}
})
.catch(error => {
@@ -131,7 +131,7 @@ const { globalUrl, setNotifications, notifications, isLoggedIn, removeCookie, ho
console.log("NEW NOTIFICATIONS: ", newNotifications)
setNotifications(newNotifications)
} else {
alert.error("Failed dismissing notification. Please try again later.")
toast("Failed dismissing notification. Please try again later.")
}
})
.catch(error => {
@@ -406,9 +406,9 @@ const { globalUrl, setNotifications, notifications, isLoggedIn, removeCookie, ho
setTimeout(() => {
window.location.reload()
}, 2000)
alert.success("Successfully changed active organization - refreshing!")
toast("Successfully changed active organization - refreshing!")
} else {
alert.error("Failed changing org: ", responseJson.reason)
toast("Failed changing org: ", responseJson.reason)
}
})
.catch(error => {