Fix issues on main route

This commit is contained in:
Pierre HUBERT 2022-06-12 18:55:26 +02:00
parent a8f1354a43
commit 0f0d907cc4

View File

@ -4,6 +4,10 @@
* @author Pierre Hubert * @author Pierre Hubert
*/ */
import { Home, Person } from "@mui/icons-material";
import CloseSharpIcon from "@mui/icons-material/CloseSharp";
import GroupIcon from "@mui/icons-material/Group";
import HistoryIcon from "@mui/icons-material/History";
import { import {
AppBar, AppBar,
Divider, Divider,
@ -12,23 +16,18 @@ import {
ListItem, ListItem,
ListItemIcon, ListItemIcon,
ListItemText, ListItemText,
makeStyles,
Paper, Paper,
Toolbar, Toolbar,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import { Home, Person } from "@mui/icons-material";
import CloseSharpIcon from "@mui/icons-material/CloseSharp";
import GroupIcon from "@mui/icons-material/Group";
import HistoryIcon from "@mui/icons-material/History";
import React from "react"; import React from "react";
import { import {
BrowserRouter as Router, BrowserRouter as Router,
Route, Route,
Routes, Routes,
useMatch,
useNavigate, useNavigate,
useParams, useParams,
useMatch,
} from "react-router-dom"; } from "react-router-dom";
import { AccountHelper, AdminAccountRole } from "../../helpers/AccountHelper"; import { AccountHelper, AdminAccountRole } from "../../helpers/AccountHelper";
import { AccountLogsRoute } from "./AccountLogsRoute"; import { AccountLogsRoute } from "./AccountLogsRoute";
@ -121,7 +120,7 @@ export function MainRoute() {
}} }}
color="primary" color="primary"
> >
<Toolbar style={{ padding: 24 }}> <Toolbar>
<Typography <Typography
component="h1" component="h1"
variant="h6" variant="h6"
@ -164,33 +163,34 @@ export function MainRoute() {
}} }}
> >
<Routes> <Routes>
<Route path="/"> <Route path="/" element={<HomeRoute />} />
<HomeRoute></HomeRoute>
</Route>
<Route path="/users"> <Route
<SearchComunicUsersRoute /> path="/users"
</Route> element={<SearchComunicUsersRoute />}
/>
<Route path="/user/:id"> <Route
<ComunicUserRouteProxy /> path="/user/:id"
</Route> element={<ComunicUserRouteProxy />}
/>
<Route path="/accounts"> <Route
<AccountsListRoute /> path="/accounts"
</Route> element={<AccountsListRoute />}
/>
<Route path="/accounts/:id"> <Route
<AccountSettingsRoute /> path="/accounts/:id"
</Route> element={<AccountSettingsRoute />}
/>
<Route path="/logs"> <Route
<AccountLogsRoute /> path="/logs"
</Route> element={<AccountLogsRoute />}
/>
<Route path="*"> <Route path="*" element={<NotFoundRoute />} />
<NotFoundRoute />
</Route>
</Routes> </Routes>
</div> </div>
</div> </div>