From 56f8aca79699c1978c87e6e778a45a8bd4fd686a Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 15 Aug 2023 16:16:40 -0300 Subject: [PATCH] format code --- .../src/components/catchAllRoutes/index.tsx | 2 +- .../src/components/headerComponent/index.tsx | 2 +- src/frontend/src/controllers/API/api.tsx | 12 +- .../src/modals/UserManagementModal/index.tsx | 1 - src/frontend/src/pages/AdminPage/index.tsx | 390 +++++++++--------- src/frontend/src/routes.tsx | 6 +- 6 files changed, 201 insertions(+), 212 deletions(-) diff --git a/src/frontend/src/components/catchAllRoutes/index.tsx b/src/frontend/src/components/catchAllRoutes/index.tsx index f6fc70883..06faa9099 100644 --- a/src/frontend/src/components/catchAllRoutes/index.tsx +++ b/src/frontend/src/components/catchAllRoutes/index.tsx @@ -6,7 +6,7 @@ export const CatchAllRoute = () => { // Redirect to the root ("/") when the catch-all route is matched useEffect(() => { - navigate('/'); + navigate("/"); }, []); return null; diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index b69fa5608..7c2e0d822 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -34,7 +34,7 @@ export default function Header() { return (
- + ⛓️ + )} +
+
+ { + handleNewUser(user); }} - variant="ghost" - className="h-8 px-2 lg:px-3" > - Reset - - - )} + + +
-
- { - handleNewUser(user); - }} - > - - -
- - {loadingUsers && ( -
- Loading... -
- )} -
- - - - Id - Username - Disabled - Superuser - Created At - Updated At - - - - {!loadingUsers && ( - - {filterUserList.map((user, index) => ( - - - - - {user.id} - - - - - - - {user.username} - - - - - - - - - - - { - new Date(user.create_at) - .toISOString() - .split("T")[0] - } - - - { - new Date(user.updated_at) - .toISOString() - .split("T")[0] - } - - -
- { - handleEditUser(user.id, editUser); - }} - > - - - - + {loadingUsers && ( +
+ Loading... +
+ )} +
+
+ + + Id + Username + Disabled + Superuser + Created At + Updated At + + + + {!loadingUsers && ( + + {filterUserList.map((user, index) => ( + + + + + {user.id} + + + + + + + {user.username} + + + + + + + + + + + { + new Date(user.create_at) + .toISOString() + .split("T")[0] + } + + + { + new Date(user.updated_at) + .toISOString() + .split("T")[0] + } + + +
+ { + handleEditUser(user.id, editUser); + }} + > + + + + - { - handleDeleteUser(user); - }} - > - - - - -
-
-
- ))} -
- )} -
-
+ { + handleDeleteUser(user); + }} + > + + + + + + + + ))} + + )} + + - { - handleChangePagination(pageSize, pageIndex); - }} - > - + { + handleChangePagination(pageSize, pageIndex); + }} + > + + - - ) - } - + )} ); } diff --git a/src/frontend/src/routes.tsx b/src/frontend/src/routes.tsx index 4c417b3bb..81421d057 100644 --- a/src/frontend/src/routes.tsx +++ b/src/frontend/src/routes.tsx @@ -1,5 +1,8 @@ import { Route, Routes } from "react-router-dom"; +import { ProtectedAdminRoute } from "./components/authAdminGuard"; +import { ProtectedRoute } from "./components/authGuard"; import { ProtectedLoginRoute } from "./components/authLoginGuard"; +import { CatchAllRoute } from "./components/catchAllRoutes"; import AdminPage from "./pages/AdminPage"; import LoginAdminPage from "./pages/AdminPage/LoginPage"; import CommunityPage from "./pages/CommunityPage"; @@ -8,9 +11,6 @@ import HomePage from "./pages/MainPage"; import DeleteAccountPage from "./pages/deleteAccountPage"; import LoginPage from "./pages/loginPage"; import SignUp from "./pages/signUpPage"; -import { CatchAllRoute } from "./components/catchAllRoutes"; -import { ProtectedRoute } from "./components/authGuard"; -import { ProtectedAdminRoute } from "./components/authAdminGuard"; const Router = () => { return (