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
+7 -6
View File
@@ -8,7 +8,8 @@ import { useNavigate, Link, useParams } from "react-router-dom";
// react plugin used to create charts
//import { Line, Bar } from "react-chartjs-2";
import { useAlert } from "react-alert";
//import { useAlert
import { ToastContainer, toast } from "react-toastify"
import Draggable from "react-draggable";
import {
@@ -332,7 +333,7 @@ const RadialChart = ({keys, setSelectedCategory}) => {
// What data do we fill in here? Idk
const Dashboard = (props) => {
const { globalUrl, isLoggedIn } = props;
const alert = useAlert();
//const alert = useAlert();
const [bigChartData, setBgChartData] = useState("data1");
const [dayAmount, setDayAmount] = useState(7);
const [firstRequest, setFirstRequest] = useState(true);
@@ -427,9 +428,9 @@ const Dashboard = (props) => {
console.log("Resp: ", responseJson)
if (responseJson.success === false) {
if (responseJson.reason !== undefined) {
//alert.error("Failed loading: " + responseJson.reason)
//toast("Failed loading: " + responseJson.reason)
} else {
//alert.error("Failed to load framework for your org.")
//toast("Failed to load framework for your org.")
}
} else {
var tmpdata = responseJson
@@ -452,7 +453,7 @@ const Dashboard = (props) => {
}
})
.catch((error) => {
//alert.error(error.toString());
//toast(error.toString());
})
}
@@ -504,7 +505,7 @@ const Dashboard = (props) => {
setChangeme(stats_id);
})
.catch((error) => {
//alert.error("ERROR: " + error.toString());
//toast("ERROR: " + error.toString());
console.log("ERROR: " + error.toString());
});
};