aboutsummaryrefslogtreecommitdiffstats
path: root/panel/src
diff options
context:
space:
mode:
Diffstat (limited to 'panel/src')
-rw-r--r--panel/src/pages/Roles.css151
-rw-r--r--panel/src/pages/Roles.jsx26
2 files changed, 130 insertions, 47 deletions
diff --git a/panel/src/pages/Roles.css b/panel/src/pages/Roles.css
index 5304391..7563805 100644
--- a/panel/src/pages/Roles.css
+++ b/panel/src/pages/Roles.css
@@ -1,64 +1,139 @@
-.manage-roles {
- display: flex;
- flex-direction: column;
- align-items: center;
- background-color: #f4f7fc;
- min-height: 100vh;
+:root {
+ --primary-color: #3498db;
+ --secondary-color: #ffffff;
+ --background-color: #f4f7fc;
+ --text-color: #333;
+ --text-light-color: #666;
+ --shadow-color: rgba(0, 0, 0, 0.1);
+ --border-radius: 10px;
}
-.manage-roles-container {
- width: 90%;
- max-width: 1200px;
- margin-top: 20px;
+/* General container styling */
+.roles-container {
+ max-width: 800px;
+ margin: 20px auto;
padding: 20px;
- background-color: white;
- border-radius: 10px;
- box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
+ background-color: var(--secondary-color);
+ border-radius: var(--border-radius);
+ box-shadow: 0 0 20px var(--shadow-color);
}
-.manage-roles-header {
+/* Heading styling */
+h1 {
text-align: center;
- margin-bottom: 30px;
-}
-
-.manage-roles-header h4 {
+ margin-bottom: 20px;
+ color: var(--text-color);
font-size: 28px;
- color: #333;
+ font-weight: bold;
+ border-bottom: 2px solid #ddd;
+ padding-bottom: 10px;
+ background: linear-gradient(to right, #3498db, #2980b9);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
}
-.user-list {
- display: flex;
- flex-direction: column;
+/* List container styling */
+.roles-list {
+ margin-bottom: 20px;
}
-.user-card {
+/* Role item styling */
+.role-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
margin-bottom: 10px;
- background-color: #f9fafc;
- border-radius: 10px;
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
+ background-color: var(--secondary-color);
+ border-radius: var(--border-radius);
+ box-shadow: 0 2px 10px var(--shadow-color);
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
+}
+
+.role-item:hover {
+ transform: translateY(-5px);
+ box-shadow: 0 4px 20px var(--shadow-color);
}
-.user-card p {
- font-size: 16px;
- color: #666;
+/* User email styling */
+.user-email {
margin: 0;
+ font-size: 1rem;
+ font-weight: bold;
+ color: var(--text-color);
+}
+
+/* Role actions container styling */
+.role-actions {
+ display: flex;
+ gap: 10px;
}
-.user-card button {
- padding: 5px 10px;
- margin-left: 10px;
- font-size: 14px;
- background-color: #007bff;
- color: white;
+/* Button styling */
+.btn {
+ padding: 10px 15px;
+ color: var(--secondary-color);
border: none;
- border-radius: 5px;
+ border-radius: var(--border-radius);
cursor: pointer;
+ transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s;
+ box-shadow: 0 2px 5px var(--shadow-color);
+ font-weight: bold;
+ font-size: 0.875rem;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+}
+
+.btn:active {
+ transform: translateY(2px);
+ box-shadow: 0 1px 3px var(--shadow-color);
+}
+
+.admin-btn {
+ background: linear-gradient(145deg, #3498db, #2980b9);
+ color: var(--secondary-color);
+}
+
+.admin-btn:hover {
+ background: linear-gradient(145deg, #2980b9, #3498db);
+}
+
+.user-btn {
+ background: linear-gradient(145deg, #bdc3c7, #95a5a6);
+ color: var(--secondary-color);
+}
+
+.user-btn:hover {
+ background: linear-gradient(145deg, #95a5a6, #bdc3c7);
}
-.user-card button.btn-secondary {
- background-color: #6c757d;
+/* Loading text styling */
+.loading-text {
+ text-align: center;
+ margin-top: 20px;
+ font-size: 18px;
+ color: var(--text-color);
+}
+
+/* Responsive design for smaller screens */
+@media (max-width: 600px) {
+ .roles-container {
+ padding: 10px;
+ }
+
+ .role-item {
+ flex-direction: column;
+ align-items: flex-start;
+ }
+
+ .role-actions {
+ margin-top: 10px;
+ width: 100%;
+ justify-content: space-between;
+ }
+
+ .btn {
+ width: 100%;
+ text-align: center;
+ }
}
diff --git a/panel/src/pages/Roles.jsx b/panel/src/pages/Roles.jsx
index 5b18ace..a30c953 100644
--- a/panel/src/pages/Roles.jsx
+++ b/panel/src/pages/Roles.jsx
@@ -3,6 +3,7 @@ import { db, auth } from '../firebase';
import { collection, getDocs } from 'firebase/firestore';
import { httpsCallable } from 'firebase/functions';
import Navbar from '../components/Navbar';
+import './Roles.css';
const Roles = () => {
const [users, setUsers] = useState([]);
@@ -30,21 +31,28 @@ const Roles = () => {
}, []);
if (loading) {
- return <p>Loading...</p>;
+ return (
+ <div className="loading-screen">
+ <div className="loading-text">Loading</div>
+ <div className="loading-dots">
+ <span>.</span><span>.</span><span>.</span>
+ </div>
+ </div>
+ );
}
return (
<div>
<Navbar />
- <div className="container mt-5">
- <h4>Manage Roles</h4>
- <div className="list-group">
+ <div className="roles-container">
+ <h1>Manage Roles</h1>
+ <div className="roles-list">
{users.map((user, index) => (
- <div key={index} className="list-group-item d-flex justify-content-between align-items-center">
- <p className="mb-0">{user.email}</p>
- <div>
- <button onClick={() => handleRoleChange(user.email, 'admin')} className="btn btn-primary btn-sm mr-2">Make Admin</button>
- <button onClick={() => handleRoleChange(user.email, 'user')} className="btn btn-secondary btn-sm">Make User</button>
+ <div key={index} className="role-item">
+ <p className="user-email">{user.email}</p>
+ <div className="role-actions">
+ <button onClick={() => handleRoleChange(user.email, 'admin')} className="btn admin-btn">Make Admin</button>
+ <button onClick={() => handleRoleChange(user.email, 'user')} className="btn user-btn">Make User</button>
</div>
</div>
))}