Skip to content

Commit

Permalink
Merge pull request #36 from uwblueprint/F24/Justin/User-Management-Pa…
Browse files Browse the repository at this point in the history
…ge-Skeleton

F24/justin/add user management and admin pages
  • Loading branch information
JustinScitech authored Oct 9, 2024
2 parents 487ef02 + 7930572 commit 8a5fd21
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import EditTeamInfoPage from "./components/pages/EditTeamPage";
import HooksDemo from "./components/pages/HooksDemo";
import NotificationsPage from "./components/pages/NotificationsPage";
import ProfilePage from "./components/pages/ProfilePage";
import UserManagementPage from "./components/pages/UserManagementPage";
import AdminPage from "./components/pages/AdminPage";

import { AuthenticatedUser } from "./types/AuthTypes";

Expand Down Expand Up @@ -131,6 +133,18 @@ const App = (): React.ReactElement => {
component={ProfilePage}
allowedRoles={AuthConstants.ALL_ROLES}
/>
<PrivateRoute
exact
path={Routes.ADMIN_PAGE}
component={AdminPage}
allowedRoles={AuthConstants.ADMIN_AND_BEHAVIOURISTS}
/>
<PrivateRoute
exact
path={Routes.USER_MANAGEMENT_PAGE}
component={UserManagementPage}
allowedRoles={AuthConstants.ADMIN_AND_BEHAVIOURISTS}
/>
<Route exact path="*" component={NotFound} />
</Switch>
</Router>
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/components/pages/AdminPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import MainPageButton from "../common/MainPageButton";

const AdminPage = (): React.ReactElement => {
return (
<div style={{ textAlign: "center", width: "25%", margin: "0px auto" }}>
<h1>Admin Page</h1>
<MainPageButton />
</div>
);
};

export default AdminPage;
13 changes: 13 additions & 0 deletions frontend/src/components/pages/UserManagementPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import MainPageButton from "../common/MainPageButton";

const UserManagementPage = (): React.ReactElement => {
return (
<div style={{ textAlign: "center", width: "25%", margin: "0px auto" }}>
<h1>User Management</h1>
<MainPageButton />
</div>
);
};

export default UserManagementPage;
4 changes: 4 additions & 0 deletions frontend/src/constants/Routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ export const NOTIFICATIONS_PAGE = "/notifications";
export const PROFILE_PAGE = "/profile";

export const DEV_UTILITY_PAGE = "/dev-utility"; // TODO: This is only here for development purposes

export const USER_MANAGEMENT_PAGE = "/admin/users";

export const ADMIN_PAGE = "/admin";

0 comments on commit 8a5fd21

Please sign in to comment.