-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsaved.patch
More file actions
709 lines (695 loc) · 55.6 KB
/
saved.patch
File metadata and controls
709 lines (695 loc) · 55.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
diff --git a/ClientApp/package-lock.json b/ClientApp/package-lock.json
index d6791ae..2dfa7b9 100644
--- a/ClientApp/package-lock.json
+++ b/ClientApp/package-lock.json
@@ -23,7 +23,6 @@
"react-scripts": "^5.0.1",
"react-transition-group": "^4.4.5",
"reactstrap": "^9.2.3",
- "rimraf": "^2.6.2",
"web-vitals": "^0.2.4",
"workbox-background-sync": "^5.1.3",
"workbox-broadcast-update": "^5.1.3",
@@ -50,6 +49,7 @@
"eslint-plugin-react": "^7.23.2",
"nan": "^2.14.2",
"postcss": "^8.5.6",
+ "rimraf": "^6.0.1",
"tailwindcss": "^3.4.13",
"typescript": "^4.2.4"
}
@@ -2664,6 +2664,29 @@
"deprecated": "Use @eslint/object-schema instead",
"license": "BSD-3-Clause"
},
+ "node_modules/@isaacs/balanced-match": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",
+ "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/@isaacs/brace-expansion": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz",
+ "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@isaacs/balanced-match": "^4.0.1"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
@@ -16399,16 +16422,106 @@
}
},
"node_modules/rimraf": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
- "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
- "deprecated": "Rimraf versions prior to v4 are no longer supported",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz",
+ "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==",
+ "dev": true,
"license": "ISC",
"dependencies": {
- "glob": "^7.1.3"
+ "glob": "^11.0.0",
+ "package-json-from-dist": "^1.0.0"
},
"bin": {
- "rimraf": "bin.js"
+ "rimraf": "dist/esm/bin.mjs"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/rimraf/node_modules/glob": {
+ "version": "11.0.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
+ "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "foreground-child": "^3.3.1",
+ "jackspeak": "^4.1.1",
+ "minimatch": "^10.0.3",
+ "minipass": "^7.1.2",
+ "package-json-from-dist": "^1.0.0",
+ "path-scurry": "^2.0.0"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/rimraf/node_modules/jackspeak": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz",
+ "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "@isaacs/cliui": "^8.0.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/rimraf/node_modules/lru-cache": {
+ "version": "11.2.2",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz",
+ "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/rimraf/node_modules/minimatch": {
+ "version": "10.1.1",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
+ "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "@isaacs/brace-expansion": "^5.0.0"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/rimraf/node_modules/path-scurry": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
+ "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "lru-cache": "^11.0.0",
+ "minipass": "^7.1.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rollup": {
diff --git a/ClientApp/package.json b/ClientApp/package.json
index 2109360..188722a 100644
--- a/ClientApp/package.json
+++ b/ClientApp/package.json
@@ -18,7 +18,6 @@
"react-scripts": "^5.0.1",
"react-transition-group": "^4.4.5",
"reactstrap": "^9.2.3",
- "rimraf": "^2.6.2",
"web-vitals": "^0.2.4",
"workbox-background-sync": "^5.1.3",
"workbox-broadcast-update": "^5.1.3",
@@ -45,6 +44,7 @@
"eslint-plugin-react": "^7.23.2",
"nan": "^2.14.2",
"postcss": "^8.5.6",
+ "rimraf": "^6.0.1",
"tailwindcss": "^3.4.13",
"typescript": "^4.2.4"
},
diff --git a/ClientApp/src/App.js b/ClientApp/src/App.js
index 1bde9d3..633317f 100644
--- a/ClientApp/src/App.js
+++ b/ClientApp/src/App.js
@@ -1,24 +1,54 @@
-// remove BrowserRouter import
-import { Routes, Route } from 'react-router-dom';
-import Layout from './components/Layout';
-import Home from './components/Home';
-import FetchData from './components/FetchData';
-import Counter from './components/Counter';
-import SignIn from './components/SignIn';
-import SignUp from './components/SignUp';
-import './custom.css';
+// src/App.js
+import { Routes, Route } from "react-router-dom";
+
+import Layout from "./components/Layout";
+import SignIn from "./components/SignIn";
+import SignUp from "./components/SignUp";
+import { RequireAuth, RequireRole } from "./components/RouteGuards";
+
+import Home from "./pages/Home";
+import FetchData from "./pages/FetchData";
+import Counter from "./pages/Counter";
+import ForgotPassword from "./pages/ForgotPassword";
+
+import AdminDashboard from "./components/dashboard/AdminDashboard";
+import TeacherDashboard from "./components/dashboard/TeacherDashboard";
+import StudentDashboard from "./components/dashboard/StudentDashboard";
+import SlpDashboard from "./components/dashboard/SlpDashboard";
+
+import "./custom.css";
export default function App() {
return (
<Layout>
<Routes>
+ {/* Public */}
<Route path="/" element={<Home />} />
<Route path="/counter" element={<Counter />} />
<Route path="/fetch-data" element={<FetchData />} />
+ <Route path="/forgot-password" element={<ForgotPassword />} />
<Route path="/sign-in" element={<SignIn />} />
<Route path="/sign-up" element={<SignUp />} />
- {/* <Route path="/forgot-password" element={<ForgotPassword />} />
- <Route path="/dashboard" element={<Dashboard />} /> */}
+
+ {/* Protected */}
+ <Route element={<RequireAuth />}>
+ <Route path="/dashboard">
+ <Route element={<RequireRole allow={["admin"]} />}>
+ <Route path="admin" element={<AdminDashboard />} />
+ </Route>
+ <Route element={<RequireRole allow={["teacher"]} />}>
+ <Route path="teacher" element={<TeacherDashboard />} />
+ </Route>
+ <Route element={<RequireRole allow={["student"]} />}>
+ <Route path="student" element={<StudentDashboard />} />
+ </Route>
+ <Route element={<RequireRole allow={["slp"]} />}>
+ <Route path="slp" element={<SlpDashboard />} />
+ </Route>
+ </Route>
+ </Route>
+
+ {/* Fallback */}
<Route path="*" element={<div className="p-3">Not found</div>} />
</Routes>
</Layout>
diff --git a/ClientApp/src/components/Counter.js b/ClientApp/src/components/Counter.js
deleted file mode 100644
index d1a421f..0000000
--- a/ClientApp/src/components/Counter.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import { useState } from "react";
-
-export default function Counter() {
- const [count, setCount] = useState(0);
-
- return (
- <div>
- <h1>Counter</h1>
- <p>This is a simple example of a React component.</p>
- <p aria-live="polite">
- Current count: <strong>{count}</strong>
- </p>
- <button className="btn btn-primary" onClick={() => setCount(c => c + 1)}>
- Increment
- </button>
- </div>
- );
-}
diff --git a/ClientApp/src/components/Dashboard.js b/ClientApp/src/components/Dashboard.js
deleted file mode 100644
index e69de29..0000000
diff --git a/ClientApp/src/components/FetchData.js b/ClientApp/src/components/FetchData.js
deleted file mode 100644
index 191809c..0000000
--- a/ClientApp/src/components/FetchData.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import { useEffect, useState } from "react";
-
-export default function FetchData() {
- const [forecasts, setForecasts] = useState([]);
- const [loading, setLoading] = useState(true);
-
- useEffect(() => {
- let active = true;
- (async () => {
- try {
- const res = await fetch("weatherforecast");
- const data = await res.json();
- if (active) {
- setForecasts(data);
- setLoading(false);
- }
- } catch (e) {
- if (active) setLoading(false);
- console.error("Failed to load weatherforecast", e);
- }
- })();
- return () => {
- active = false;
- };
- }, []);
-
- const renderTable = (rows) => (
- <table className="table table-striped" aria-labelledby="tableLabel">
- <thead>
- <tr>
- <th>Date</th>
- <th>Temp. (C)</th>
- <th>Temp. (F)</th>
- <th>Summary</th>
- </tr>
- </thead>
- <tbody>
- {rows.map((f, i) => (
- <tr key={f.date ?? i}>
- <td>{f.date}</td>
- <td>{f.temperatureC}</td>
- <td>{f.temperatureF}</td>
- <td>{f.summary}</td>
- </tr>
- ))}
- </tbody>
- </table>
- );
-
- return (
- <div>
- <h1 id="tableLabel">Weather forecast</h1>
- <p>This component demonstrates fetching data from the server.</p>
- {loading ? <p><em>Loading...</em></p> : renderTable(forecasts)}
- </div>
- );
-}
diff --git a/ClientApp/src/components/ForgotPassword.js b/ClientApp/src/components/ForgotPassword.js
deleted file mode 100644
index e69de29..0000000
diff --git a/ClientApp/src/components/Home.js b/ClientApp/src/components/Home.js
deleted file mode 100644
index 7e30841..0000000
--- a/ClientApp/src/components/Home.js
+++ /dev/null
@@ -1,44 +0,0 @@
-export default function Home() {
- return (
- <div>
- <h1>Hello, world!</h1>
- <p>Welcome to your new single-page application, built with:</p>
- <ul>
- <li>
- <a href="https://get.asp.net/">ASP.NET Core</a> and{" "}
- <a href="https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx">C#</a>{" "}
- for cross-platform server-side code
- </li>
- <li>
- <a href="https://facebook.github.io/react/">React</a> for client-side code
- </li>
- <li>
- <a href="http://getbootstrap.com/">Bootstrap</a> for layout and styling
- </li>
- </ul>
- <p>To help you get started, we have also set up:</p>
- <ul>
- <li>
- <strong>Client-side navigation</strong>. For example, click <em>Counter</em> then{" "}
- <em>Back</em> to return here.
- </li>
- <li>
- <strong>Development server integration</strong>. In development mode, the development
- server from <code>create-react-app</code> runs in the background automatically, so your
- client-side resources are dynamically built on demand and the page refreshes when you
- modify any file.
- </li>
- <li>
- <strong>Efficient production builds</strong>. In production mode, development-time
- features are disabled, and your <code>dotnet publish</code> configuration produces
- minified, efficiently bundled JavaScript files.
- </li>
- </ul>
- <p>
- The <code>ClientApp</code> subdirectory is a standard React application based on the{" "}
- <code>create-react-app</code> template. If you open a command prompt in that directory, you
- can run <code>npm</code> commands such as <code>npm test</code> or <code>npm install</code>.
- </p>
- </div>
- );
-}
diff --git a/ClientApp/src/components/SignIn.js b/ClientApp/src/components/SignIn.js
index 7e8a449..40006d2 100644
--- a/ClientApp/src/components/SignIn.js
+++ b/ClientApp/src/components/SignIn.js
@@ -1,21 +1,27 @@
import { useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { EyeSlashIcon, EyeIcon } from "@heroicons/react/24/solid";
+import { findUser, signInSession, dashboardPathForRole } from "../utils/auth";
export default function SignIn() {
const [passwordShown, setPasswordShown] = useState(false);
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
+ const [err, setErr] = useState("");
const navigate = useNavigate();
function handleSubmit(e) {
e.preventDefault();
- localStorage.setItem("authUser", JSON.stringify({ email }));
- navigate("/dashboard");
+ const user = findUser(email, password);
+ if (!user) {
+ setErr("Invalid email or password");
+ return;
+ }
+ signInSession(user);
+ navigate(dashboardPathForRole(user.role), { replace: true });
}
return (
- // <div className="min-h-screen bg-white text-gray-900 flex flex-col justify-center px-6 py-12 lg:px-8">
<div className="min-h-screen bg-white text-gray-900 flex flex-col px-6 py-12 lg:px-8 mt-[100px]">
<div className="sm:mx-auto sm:w-full sm:max-w-sm">
<h2 className="mt-10 text-center text-2xl font-bold tracking-tight">
@@ -25,6 +31,8 @@ export default function SignIn() {
<div className="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
<form onSubmit={handleSubmit} className="space-y-6">
+ {err && <p className="text-sm text-red-600">{err}</p>}
+
{/* Email */}
<div>
<label htmlFor="email" className="block text-sm font-medium text-gray-900">
@@ -78,11 +86,7 @@ export default function SignIn() {
className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700"
aria-label="Toggle password visibility"
>
- {passwordShown ? (
- <EyeSlashIcon className="h-5 w-5" />
- ) : (
- <EyeIcon className="h-5 w-5" />
- )}
+ {passwordShown ? <EyeSlashIcon className="h-5 w-5" /> : <EyeIcon className="h-5 w-5" />}
</button>
</div>
</div>
@@ -103,11 +107,7 @@ export default function SignIn() {
Sign up
</Link>
</p>
-
</div>
</div>
);
}
-
-
-
diff --git a/ClientApp/src/components/SignUp.js b/ClientApp/src/components/SignUp.js
index 5416460..57c4b56 100644
--- a/ClientApp/src/components/SignUp.js
+++ b/ClientApp/src/components/SignUp.js
@@ -1,111 +1,137 @@
+import { useState } from "react";
+import { useNavigate } from "react-router-dom";
+import { saveUser, signInSession, dashboardPathForRole } from "../utils/auth";
+export default function SignUp() {
+ const [email, setEmail] = useState("");
+ const [password, setPassword] = useState("");
+ const [fullName, setFullName] = useState("");
+ const [role, setRole] = useState("");
+ const [err, setErr] = useState("");
+ const navigate = useNavigate();
+ function handleSubmit(e) {
+ e.preventDefault();
+ if (!role) {
+ setErr("Please select a role");
+ return;
+ }
+ const user = { email, password, fullName, role };
+ saveUser(user);
+ signInSession(user);
+ navigate(dashboardPathForRole(role), { replace: true });
+ }
-export default function SignUp() {
+ return (
+ <div className="min-h-screen bg-white text-gray-900 flex flex-col px-6 py-12 lg:px-8 mt-[100px]">
+ <div className="sm:mx-auto sm:w-full sm:max-w-sm">
+ <h2 className="mt-10 text-center text-2xl font-bold tracking-tight">
+ Sign Up for an account
+ </h2>
+ </div>
- return (
- // <div className="min-h-screen bg-white text-gray-900 flex flex-col justify-center px-6 py-12 lg:px-8">
- <div className="min-h-screen bg-white text-gray-900 flex flex-col px-6 py-12 lg:px-8 mt-[100px]">
- <div className="sm:mx-auto sm:w-full sm:max-w-sm">
- <h2 className="mt-10 text-center text-2xl font-bold tracking-tight">
- Sign Up for an account
- </h2>
- </div>
+ <div className="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
+ <form onSubmit={handleSubmit} className="space-y-6">
+ {err && <p className="text-sm text-red-600">{err}</p>}
- <div className="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
- <form className="space-y-6">
- {/* Email */}
- <div>
- <label htmlFor="email" className="block text-sm font-medium text-gray-900">
- Email address
- </label>
- <div className="mt-2">
- <input
- id="email"
- name="email"
- type="email"
- autoComplete="email"
- required
- className="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
- placeholder="name@mail.com"
- />
- </div>
- </div>
+ {/* Email */}
+ <div>
+ <label htmlFor="email" className="block text-sm font-medium text-gray-900">
+ Email address
+ </label>
+ <div className="mt-2">
+ <input
+ id="email"
+ name="email"
+ type="email"
+ autoComplete="email"
+ required
+ value={email}
+ onChange={(e) => setEmail(e.target.value)}
+ className="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
+ placeholder="name@mail.com"
+ />
+ </div>
+ </div>
- {/* Password */}
- <div>
- <div className="flex items-center justify-between">
- <label htmlFor="password" className="block text-sm font-medium text-gray-900">
- Password
- </label>
- </div>
- <div className="mt-2 relative">
- <input
- id="password"
- name="password"
- type="password"
- autoComplete="current-password"
- required
- className="block w-full rounded-md bg-white px-3 py-1.5 pr-10 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
- placeholder="********"
- />
- </div>
- </div>
-
- {/*Full Name */}
- <div>
- <div className="flex items-center justify-between">
- <label htmlFor="fullName" className="block text-sm font-medium text-gray-900">
- Full Name
- </label>
- </div>
- <div className="mt-2">
- <input
- id="fullName"
- name="fullName"
- type="text"
- autoComplete="name"
- required
- className="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
- placeholder="First M. Last"
- />
- </div>
- </div>
+ {/* Password */}
+ <div>
+ <div className="flex items-center justify-between">
+ <label htmlFor="password" className="block text-sm font-medium text-gray-900">
+ Password
+ </label>
+ </div>
+ <div className="mt-2 relative">
+ <input
+ id="password"
+ name="password"
+ type="password"
+ autoComplete="new-password"
+ required
+ value={password}
+ onChange={(e) => setPassword(e.target.value)}
+ className="block w-full rounded-md bg-white px-3 py-1.5 pr-10 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
+ placeholder="********"
+ />
+ </div>
+ </div>
- {/* Role Selection */}
- <div>
- <label htmlFor="role" className="block text-sm font-medium text-gray-900">
- Role
- </label>
- <div className="mt-2">
- <select
- id="role"
- name="role"
- required
- className="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
- >
- <option value="">Select a role</option>
- <option value="teacher">Teacher</option>
- <option value="student">Student</option>
- <option value="slp">SLP</option>
- <option value="admin">Admin</option>
- </select>
- </div>
- </div>
-
- {/* Submit Button */}
- <div>
- <button
- type="submit"
- className="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
- >
- Sign Up
- </button>
- </div>
- </form>
+ {/* Full Name */}
+ <div>
+ <div className="flex items-center justify-between">
+ <label htmlFor="fullName" className="block text-sm font-medium text-gray-900">
+ Full Name
+ </label>
</div>
- </div>
- );
+ <div className="mt-2">
+ <input
+ id="fullName"
+ name="fullName"
+ type="text"
+ autoComplete="name"
+ required
+ value={fullName}
+ onChange={(e) => setFullName(e.target.value)}
+ className="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
+ placeholder="First M. Last"
+ />
+ </div>
+ </div>
+ {/* Role Selection */}
+ <div>
+ <label htmlFor="role" className="block text-sm font-medium text-gray-900">
+ Role
+ </label>
+ <div className="mt-2">
+ <select
+ id="role"
+ name="role"
+ required
+ value={role}
+ onChange={(e) => setRole(e.target.value)}
+ className="block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm"
+ >
+ <option value="">Select a role</option>
+ <option value="teacher">Teacher</option>
+ <option value="student">Student</option>
+ <option value="slp">SLP</option>
+ <option value="admin">Admin</option>
+ </select>
+ </div>
+ </div>
-}
\ No newline at end of file
+ {/* Submit Button */}
+ <div>
+ <button
+ type="submit"
+ className="flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
+ >
+ Sign Up
+ </button>
+ </div>
+ </form>
+ </div>
+ </div>
+ );
+}