From ed6985c6705851e9707ef89efac79e6ff9c04838 Mon Sep 17 00:00:00 2001 From: Jesper <> Date: Wed, 9 Oct 2024 19:56:04 +0200 Subject: [PATCH] Frontend --- frontend/src/pages/Admin/index.tsx | 170 +++++++++++++++-------------- frontend/src/pages/Admin/style.css | 15 +-- 2 files changed, 92 insertions(+), 93 deletions(-) diff --git a/frontend/src/pages/Admin/index.tsx b/frontend/src/pages/Admin/index.tsx index 9b0f5da..ac65e3f 100644 --- a/frontend/src/pages/Admin/index.tsx +++ b/frontend/src/pages/Admin/index.tsx @@ -143,96 +143,98 @@ export function Admin() {

Admin Dashboard

-
-

Users

- -
- -
-

Groups

- -
- -
-

Add User to Group

-
{ - e.preventDefault(); - const userId = e.target.userId.value; - if (selectedGroupId) addUserToGroup(userId); - }}> - - - -
-
+ +
-
-

Register New User

-
- setNewUser({ ...newUser, username: e.target.value })} - required - /> - setNewUser({ ...newUser, password: e.target.value })} - required - /> - setNewUser({ ...newUser, name: e.target.value })} - required - /> - -
-
+
+

Add User to Group

+
{ + e.preventDefault(); + const userId = e.target.userId.value; + if (selectedGroupId) addUserToGroup(userId); + }}> + + + +
+
-
-

Create New Group

-
- setNewGroupName(e.target.value)} - required - /> - -
+
+

Register New User

+
+ setNewUser({ ...newUser, username: e.target.value })} + required + /> + setNewUser({ ...newUser, password: e.target.value })} + required + /> + setNewUser({ ...newUser, name: e.target.value })} + required + /> + +
+
+ +
+

Create New Group

+
+ setNewGroupName(e.target.value)} + required + /> + +
+
); diff --git a/frontend/src/pages/Admin/style.css b/frontend/src/pages/Admin/style.css index 50ba180..3288a0a 100644 --- a/frontend/src/pages/Admin/style.css +++ b/frontend/src/pages/Admin/style.css @@ -14,12 +14,11 @@ color: #b682ff; } -/* Flexbox Layout */ .grid-container { display: flex; - flex-wrap: wrap; /* Wrap the sections into the next row when needed */ + flex-wrap: wrap; gap: 20px; - justify-content: space-between; /* Distribute the sections horizontally with space between */ + justify-content: space-between; } .section { @@ -27,8 +26,8 @@ padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); - flex: 1 1 30%; /* Make the section take up approximately 30% of the row */ - min-width: 280px; /* Ensure each section has a minimum width */ + flex: 1 1 30%; + min-width: 280px; box-sizing: border-box; transition: transform 0.2s ease; } @@ -43,7 +42,6 @@ h2 { margin-bottom: 15px; } -/* List Styles */ ul { list-style: none; padding: 0; @@ -102,15 +100,14 @@ button:hover { background-color: #9b50ff; } -/* Responsive Adjustments */ @media (max-width: 900px) { .section { - flex: 1 1 45%; /* For medium screens, display 2 sections per row */ + flex: 1 1 45%; } } @media (max-width: 600px) { .section { - flex: 1 1 100%; /* For small screens, each section takes full width */ + flex: 1 1 100%; } }