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 -5
View File
@@ -2,7 +2,8 @@ import React, { useEffect, useState } from 'react';
import ReactDOM from "react-dom"
import AppFramework from "../components/AppFramework.jsx";
import { useAlert } from "react-alert";
//import { useAlert
import { ToastContainer, toast } from "react-toastify"
import { Link, useParams } from "react-router-dom";
import theme from '../theme.jsx';
@@ -13,7 +14,7 @@ import {
const Framework = (props) => {
const {globalUrl, isLoaded, isLoggedIn, showOptions, selectedOption, rolling, } = props;
const alert = useAlert()
//const alert = useAlert()
const [frameworkLoaded, setFrameworkLoaded] = useState(false)
const [frameworkData, setFrameworkData] = useState()
@@ -36,9 +37,9 @@ const Framework = (props) => {
.then((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.")
}
setFrameworkLoaded(true)
@@ -51,7 +52,7 @@ const Framework = (props) => {
})
.catch((error) => {
setFrameworkLoaded(true)
alert.error(error.toString());
toast(error.toString());
})
}