mirror of
https://github.com/hubHarmony/servii-frontend.git
synced 2024-11-17 21:40:30 +00:00
[+] react-toastify integration
This commit is contained in:
parent
7cba360e42
commit
a58091b76a
13
src/App.jsx
13
src/App.jsx
@ -37,7 +37,18 @@ const App = () => {
|
|||||||
<Route path="/" element={<Navigate to={user ? "/dashboard" : "/login"} />} />
|
<Route path="/" element={<Navigate to={user ? "/dashboard" : "/login"} />} />
|
||||||
<Route path="*" element={<NotFoundPage />} />
|
<Route path="*" element={<NotFoundPage />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
<ToastContainer />
|
<ToastContainer
|
||||||
|
position="top-center"
|
||||||
|
autoClose={2500}
|
||||||
|
hideProgressBar={false}
|
||||||
|
newestOnTop={false}
|
||||||
|
closeOnClick
|
||||||
|
rtl={false}
|
||||||
|
pauseOnFocusLoss
|
||||||
|
draggable
|
||||||
|
pauseOnHover
|
||||||
|
theme="colored"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { getAuth } from 'firebase/auth';
|
import { getAuth } from 'firebase/auth';
|
||||||
|
import {Bounce, toast} from "react-toastify";
|
||||||
|
|
||||||
const apiUrl: string = 'https://www.servii.fr/api';
|
const apiUrl: string = 'https://www.servii.fr/api';
|
||||||
|
|
||||||
@ -68,6 +69,17 @@ class serviiApi {
|
|||||||
}
|
}
|
||||||
return { return_code: status, message: json };
|
return { return_code: status, message: json };
|
||||||
}
|
}
|
||||||
|
toast.info(json.message, {
|
||||||
|
position: "top-center",
|
||||||
|
autoClose: 2500,
|
||||||
|
hideProgressBar: false,
|
||||||
|
closeOnClick: true,
|
||||||
|
pauseOnHover: true,
|
||||||
|
draggable: true,
|
||||||
|
progress: undefined,
|
||||||
|
theme: "colored",
|
||||||
|
transition: Bounce,
|
||||||
|
});
|
||||||
return { return_code: status, message: json.message };
|
return { return_code: status, message: json.message };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user