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
+4 -4
View File
@@ -17,7 +17,7 @@ import {
Save as SaveIcon,
} from "@mui/icons-material";
import { useAlert } from "react-alert";
//import { useAlert
const useStyles = makeStyles({
notchedOutline: {
@@ -39,7 +39,7 @@ const OrgHeader = (props) => {
handleEditOrg,
} = props;
const alert = useAlert();
//const alert = useAlert();
const classes = useStyles();
var upload = "";
@@ -210,13 +210,13 @@ const OrgHeader = (props) => {
const invalid = ["#", ":", "."];
for (var key in invalid) {
if (e.target.value.includes(invalid[key])) {
alert.error("Can't use " + invalid[key] + " in name");
toast("Can't use " + invalid[key] + " in name");
return;
}
}
if (e.target.value.length > 100) {
alert.error("Choose a shorter name.");
toast("Choose a shorter name.");
return;
}