2024-10-03 21:15:48 +03:00
|
|
|
import React, {useEffect} from 'react';
|
2024-09-20 16:10:14 +03:00
|
|
|
|
2024-10-03 21:15:48 +03:00
|
|
|
import { BrowserRouter } from 'react-router-dom';
|
2024-09-20 16:10:14 +03:00
|
|
|
import { Dashboard } from './dashboard';
|
|
|
|
|
2024-10-03 21:15:48 +03:00
|
|
|
import {ToastContainer} from "react-toastify";
|
|
|
|
import 'react-toastify/dist/ReactToastify.css';
|
|
|
|
|
2024-09-28 12:51:59 +03:00
|
|
|
|
2024-09-20 16:10:14 +03:00
|
|
|
import './index.css'
|
2024-10-03 21:15:48 +03:00
|
|
|
import {displayMessage} from "./backend/notifications/notifications.js";
|
|
|
|
import {MessageType} from "./backend/notifications/message";
|
2024-09-07 11:27:38 +03:00
|
|
|
|
2024-10-03 21:15:48 +03:00
|
|
|
const App = () => {
|
|
|
|
useEffect(() => {
|
|
|
|
document.title = 'Enterfront';
|
|
|
|
}, []);
|
2024-09-28 12:51:59 +03:00
|
|
|
|
2024-10-03 21:15:48 +03:00
|
|
|
useEffect(() => {
|
|
|
|
const msg = localStorage.getItem('message');
|
|
|
|
|
|
|
|
if (!msg) return;
|
|
|
|
|
|
|
|
displayMessage(msg, MessageType.SUCCESS);
|
|
|
|
localStorage.removeItem('message');
|
|
|
|
}, []);
|
2024-09-28 12:51:59 +03:00
|
|
|
|
2024-09-20 16:10:14 +03:00
|
|
|
return(
|
2024-10-03 21:15:48 +03:00
|
|
|
<div>
|
|
|
|
<BrowserRouter>
|
|
|
|
<Dashboard />
|
|
|
|
</BrowserRouter>
|
|
|
|
|
|
|
|
<ToastContainer/>
|
|
|
|
</div>
|
|
|
|
|
2024-09-20 16:10:14 +03:00
|
|
|
)
|
|
|
|
}
|
2024-09-07 11:27:38 +03:00
|
|
|
|
2024-09-20 16:10:14 +03:00
|
|
|
export default App;
|