2024-07-17 20:15:45 -04:00
|
|
|
import { Routes, Route } from "react-router-dom";
|
2024-07-19 10:40:40 -07:00
|
|
|
import "react-toastify/dist/ReactToastify.css";
|
|
|
|
|
import { ToastContainer } from "react-toastify";
|
2024-05-22 19:09:13 +03:30
|
|
|
// import "./App.css";
|
2024-05-22 17:46:58 +03:30
|
|
|
import NotFound from "./Pages/NotFound";
|
2024-07-17 20:15:45 -04:00
|
|
|
import Login from "./Pages/Auth/Login";
|
2024-07-19 10:05:18 -07:00
|
|
|
import Register from "./Pages/Auth/Register/Register";
|
2024-05-22 17:46:58 +03:30
|
|
|
import HomeLayout from "./Layouts/HomeLayout";
|
2024-06-27 19:19:36 -04:00
|
|
|
import Account from "./Pages/Account";
|
2024-08-27 15:18:18 -07:00
|
|
|
import Monitors from "./Pages/Monitors/Home";
|
2024-07-17 20:15:45 -04:00
|
|
|
import CreateMonitor from "./Pages/Monitors/CreateMonitor";
|
2024-05-22 17:14:34 -04:00
|
|
|
import Incidents from "./Pages/Incidents";
|
|
|
|
|
import Status from "./Pages/Status";
|
|
|
|
|
import Integrations from "./Pages/Integrations";
|
|
|
|
|
import Settings from "./Pages/Settings";
|
2024-07-17 20:15:45 -04:00
|
|
|
import ForgotPassword from "./Pages/Auth/ForgotPassword";
|
|
|
|
|
import CheckEmail from "./Pages/Auth/CheckEmail";
|
|
|
|
|
import SetNewPassword from "./Pages/Auth/SetNewPassword";
|
|
|
|
|
import NewPasswordConfirmed from "./Pages/Auth/NewPasswordConfirmed";
|
2024-06-24 11:56:25 -07:00
|
|
|
import ProtectedRoute from "./Components/ProtectedRoute";
|
2024-07-17 20:15:45 -04:00
|
|
|
import Details from "./Pages/Monitors/Details";
|
2024-07-07 22:02:08 -04:00
|
|
|
import Maintenance from "./Pages/Maintenance";
|
2024-07-19 10:40:40 -07:00
|
|
|
import withAdminCheck from "./HOC/withAdminCheck";
|
2024-08-27 12:54:44 -07:00
|
|
|
import withAdminProp from "./HOC/withAdminProp";
|
2024-07-19 14:35:11 -04:00
|
|
|
import Configure from "./Pages/Monitors/Configure";
|
2024-07-28 16:51:47 -04:00
|
|
|
import PageSpeed from "./Pages/PageSpeed";
|
|
|
|
|
import CreatePageSpeed from "./Pages/PageSpeed/CreatePageSpeed";
|
2024-08-03 09:40:08 +03:30
|
|
|
import CreateNewMaintenanceWindow from "./Pages/Maintenance/CreateMaintenanceWindow";
|
2024-08-02 17:47:22 -04:00
|
|
|
import PageSpeedDetails from "./Pages/PageSpeed/Details";
|
2024-08-08 15:41:15 -04:00
|
|
|
import PageSpeedConfigure from "./Pages/PageSpeed/Configure";
|
2024-08-28 22:14:55 -04:00
|
|
|
import { ThemeProvider } from "@emotion/react";
|
2024-08-29 17:14:17 -04:00
|
|
|
import lightTheme from "./Utils/Theme/lightTheme";
|
|
|
|
|
import darkTheme from "./Utils/Theme/darkTheme";
|
2024-08-28 22:14:55 -04:00
|
|
|
import { useSelector } from "react-redux";
|
2024-07-09 17:32:24 -07:00
|
|
|
|
2024-05-03 12:29:37 -04:00
|
|
|
function App() {
|
2024-07-19 10:40:40 -07:00
|
|
|
const AdminCheckedRegister = withAdminCheck(Register);
|
2024-08-27 12:54:44 -07:00
|
|
|
const MonitorsWithAdminProp = withAdminProp(Monitors);
|
|
|
|
|
const DetailsWithAdminProp = withAdminProp(Details);
|
2024-08-27 15:26:16 -07:00
|
|
|
const PageSpeedWithAdminProp = withAdminProp(PageSpeed);
|
2024-08-28 10:28:02 -04:00
|
|
|
const MaintenanceWithAdminProp = withAdminProp(Maintenance);
|
2024-08-30 10:09:38 -07:00
|
|
|
const SettingsWithAdminProp = withAdminProp(Settings);
|
2024-08-28 22:14:55 -04:00
|
|
|
|
2024-08-29 02:19:19 -04:00
|
|
|
const mode = useSelector((state) => state.ui.mode);
|
2024-08-28 22:14:55 -04:00
|
|
|
|
2024-05-03 12:29:37 -04:00
|
|
|
return (
|
2024-08-29 17:14:17 -04:00
|
|
|
<ThemeProvider theme={mode === "light" ? lightTheme : darkTheme}>
|
2024-05-22 17:46:58 +03:30
|
|
|
<Routes>
|
2024-05-28 21:28:15 +03:30
|
|
|
<Route exact path="/" element={<HomeLayout />}>
|
2024-06-24 13:27:38 -07:00
|
|
|
<Route
|
|
|
|
|
exact
|
|
|
|
|
path="/"
|
2024-08-27 12:54:44 -07:00
|
|
|
element={<ProtectedRoute Component={MonitorsWithAdminProp} />}
|
2024-06-24 13:27:38 -07:00
|
|
|
/>
|
2024-06-24 11:56:25 -07:00
|
|
|
<Route
|
|
|
|
|
path="/monitors"
|
2024-08-27 12:54:44 -07:00
|
|
|
element={<ProtectedRoute Component={MonitorsWithAdminProp} />}
|
2024-06-24 11:56:25 -07:00
|
|
|
/>
|
2024-06-25 14:36:20 -07:00
|
|
|
<Route
|
|
|
|
|
path="/monitors/create"
|
2024-07-17 20:15:45 -04:00
|
|
|
element={<ProtectedRoute Component={CreateMonitor} />}
|
2024-06-25 14:36:20 -07:00
|
|
|
/>
|
2024-06-24 13:03:42 -07:00
|
|
|
<Route
|
2024-07-10 09:59:48 -07:00
|
|
|
path="/monitors/:monitorId/"
|
2024-08-27 12:54:44 -07:00
|
|
|
element={<ProtectedRoute Component={DetailsWithAdminProp} />}
|
2024-06-24 13:03:42 -07:00
|
|
|
/>
|
2024-07-19 14:35:11 -04:00
|
|
|
<Route
|
|
|
|
|
path="/monitors/configure/:monitorId/"
|
|
|
|
|
element={<ProtectedRoute Component={Configure} />}
|
|
|
|
|
/>
|
2024-07-03 20:07:45 -07:00
|
|
|
<Route
|
2024-07-10 09:59:48 -07:00
|
|
|
path="incidents"
|
|
|
|
|
element={<ProtectedRoute Component={Incidents} />}
|
2024-07-03 20:07:45 -07:00
|
|
|
/>
|
2024-07-10 09:59:48 -07:00
|
|
|
|
2024-06-24 13:03:42 -07:00
|
|
|
<Route
|
|
|
|
|
path="status"
|
|
|
|
|
element={<ProtectedRoute Component={Status} />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="integrations"
|
|
|
|
|
element={<ProtectedRoute Component={Integrations} />}
|
|
|
|
|
/>
|
2024-07-07 22:02:08 -04:00
|
|
|
<Route
|
|
|
|
|
path="maintenance"
|
2024-08-28 10:28:02 -04:00
|
|
|
element={<ProtectedRoute Component={MaintenanceWithAdminProp} />}
|
2024-07-07 22:02:08 -04:00
|
|
|
/>
|
2024-08-03 09:40:08 +03:30
|
|
|
<Route
|
|
|
|
|
path="/maintenance/create"
|
|
|
|
|
element={<CreateNewMaintenanceWindow />}
|
|
|
|
|
/>
|
2024-06-24 13:03:42 -07:00
|
|
|
<Route
|
|
|
|
|
path="settings"
|
2024-08-30 10:09:38 -07:00
|
|
|
element={<ProtectedRoute Component={SettingsWithAdminProp} />}
|
2024-06-24 13:03:42 -07:00
|
|
|
/>
|
2024-06-27 19:19:36 -04:00
|
|
|
<Route
|
|
|
|
|
path="account/profile"
|
|
|
|
|
element={<ProtectedRoute Component={Account} open="profile" />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="account/password"
|
|
|
|
|
element={<ProtectedRoute Component={Account} open="password" />}
|
|
|
|
|
/>
|
|
|
|
|
<Route
|
|
|
|
|
path="account/team"
|
|
|
|
|
element={<ProtectedRoute Component={Account} open="team" />}
|
|
|
|
|
/>
|
2024-07-28 16:51:47 -04:00
|
|
|
<Route
|
2024-08-02 18:08:36 -04:00
|
|
|
path="pagespeed"
|
2024-08-27 15:26:16 -07:00
|
|
|
element={<ProtectedRoute Component={PageSpeedWithAdminProp} />}
|
2024-07-28 16:51:47 -04:00
|
|
|
/>
|
|
|
|
|
<Route
|
2024-08-02 18:08:36 -04:00
|
|
|
path="pagespeed/create"
|
2024-07-28 16:51:47 -04:00
|
|
|
element={<ProtectedRoute Component={CreatePageSpeed} />}
|
|
|
|
|
/>
|
2024-08-02 17:47:22 -04:00
|
|
|
<Route
|
2024-08-02 18:17:52 -04:00
|
|
|
path="pagespeed/:monitorId"
|
2024-08-02 17:47:22 -04:00
|
|
|
element={<ProtectedRoute Component={PageSpeedDetails} />}
|
|
|
|
|
/>
|
2024-08-08 15:41:15 -04:00
|
|
|
<Route
|
|
|
|
|
path="pagespeed/configure/:monitorId"
|
|
|
|
|
element={<ProtectedRoute Component={PageSpeedConfigure} />}
|
|
|
|
|
/>
|
2024-05-22 17:14:34 -04:00
|
|
|
</Route>
|
2024-06-24 13:27:38 -07:00
|
|
|
|
|
|
|
|
<Route exact path="/login" element={<Login />} />
|
2024-07-19 10:40:40 -07:00
|
|
|
|
|
|
|
|
<Route exact path="/register" element={<AdminCheckedRegister />} />
|
|
|
|
|
<Route exact path="/register/:token" element={<Register />} />
|
2024-06-21 15:11:54 -07:00
|
|
|
{/* <Route path="/toast" element={<ToastComponent />} /> */}
|
2024-05-14 11:06:34 +03:30
|
|
|
<Route path="*" element={<NotFound />} />
|
2024-05-28 21:28:15 +03:30
|
|
|
<Route path="/forgot-password" element={<ForgotPassword />} />
|
2024-05-29 11:08:59 +03:30
|
|
|
<Route path="/check-email" element={<CheckEmail />} />
|
2024-06-11 11:19:50 -07:00
|
|
|
<Route path="/set-new-password/:token" element={<SetNewPassword />} />
|
2024-05-30 11:08:50 +03:30
|
|
|
<Route
|
|
|
|
|
path="/new-password-confirmed"
|
|
|
|
|
element={<NewPasswordConfirmed />}
|
|
|
|
|
/>
|
2024-05-22 17:46:58 +03:30
|
|
|
</Routes>
|
2024-07-12 14:00:16 -04:00
|
|
|
<ToastContainer />
|
2024-08-28 22:14:55 -04:00
|
|
|
</ThemeProvider>
|
2024-05-11 22:48:09 +03:30
|
|
|
);
|
2024-05-03 12:29:37 -04:00
|
|
|
}
|
|
|
|
|
|
2024-05-11 22:48:09 +03:30
|
|
|
export default App;
|