Skip to content

Commit 42d82a4

Browse files
committed
Continued frontend polish. Made About Page directly accessible from Login/Register pages (adjusting how About Page is loaded depending on if the user is authorized or not).
1 parent 4ed302e commit 42d82a4

8 files changed

Lines changed: 231 additions & 127 deletions

File tree

springqpro-frontend/src/components/TaskDetailDrawer.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
// Just a modular panel that'll contain Task detail when you click a specific Task on the Tasks/Task Dashboard Page.
2-
/* This wil slide in from the right-hand side of the screen, show the full task JSON, show the GraphQL query
3-
used to fetch it, and includes a close button.
1+
/* TaskDetailDrawer.tsx:
2+
------------------------
3+
This is just an external modular panel in which specific Task details will be displayed when you click on a specific
4+
Task in the Task Dashboard page (TaskDashboardPage.tsx). It'll slide in from the right-hand side of the screen, show
5+
the full task JSON, show the GraphQL query used to fetch it, and include a close button.
6+
------------------------
7+
TL;DR: It is a stateless, presentational UI overlay. This is just a cosmetic "drawer" component.
48
*/
9+
510
interface TaskDetailDrawerProps {
6-
task: any | null;
11+
task: any | null; // <-- NOTE: I can maybe tighten this to be an explicit Task interface eventually. This is probably bad TypeScript practice.
712
graphqlQuery: string;
813
onClose: () => void;
914
}
@@ -61,7 +66,7 @@ export default function TaskDetailDrawer({
6166
overflowX: "auto",
6267
}}
6368
>
64-
{graphqlQuery}
69+
{graphqlQuery}
6570
</pre>
6671

6772
<h4 style={{ marginTop: "20px" }}>Task JSON</h4>
@@ -74,7 +79,7 @@ export default function TaskDetailDrawer({
7479
overflowX: "auto",
7580
}}
7681
>
77-
{JSON.stringify(task, null, 2)}
82+
{JSON.stringify(task, null, 2)}
7883
</pre>
7984
</div>
8085
);

springqpro-frontend/src/pages/AboutPage.tsx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
11
import NavBar from "../components/NavBar";
22

3+
/* 2026-01-28-NOTE: Adding authorization context to About Page to alter how this page is loaded
4+
depending on if the user is logged in or not. I want the About Page to be viewable from the Login/Register page
5+
(meaning the user hasn't yet logged in or doesn't yet have an account). The About Page certainly should not be gated!
6+
---
7+
- I'm going to hide the Navigation Bar behind Access Token check.
8+
- I'm going to replace it with a "Return to Login/Registration Page" bar or button instead!
9+
*/
10+
import { useAuth } from "../utility/auth/AuthContext";
11+
import { Link } from "react-router-dom";
12+
313
export default function AboutPage() {
14+
const { accessToken } = useAuth();
15+
416
return (
517
<div>
6-
<NavBar />
18+
19+
{/* If the user is viewing the About Page in an authorized context, navigation bar appears. */}
20+
{accessToken && (<NavBar />)}
21+
{/* If the user is not authenticated, navigation bar would be replaced with a similar bar re-directing to the Auth pages: */}
22+
{!accessToken && (
23+
<div className="navBar">
24+
<nav className="navContainer">
25+
<div className="navLeft">
26+
<Link to="/login" className="navLink">
27+
Login
28+
</Link>
29+
<Link to="/register" className="navLink">
30+
Register
31+
</Link>
32+
</div>
33+
</nav>
34+
</div>
35+
)}
36+
737
<div
838
style={{
939
fontFamily: "monospace",

springqpro-frontend/src/pages/LoginPage.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState, useEffect, useRef } from "react";
22
import { loginUser } from "../api/api.ts";
33
import { useAuth } from "../utility/auth/AuthContext";
4-
import { useNavigate } from "react-router-dom";
4+
import { Link, useNavigate } from "react-router-dom";
55

66
export default function LoginPage() {
77
// React Refs:
@@ -186,6 +186,20 @@ export default function LoginPage() {
186186
Create an account →
187187
</a>
188188
</div>
189+
190+
<div>
191+
Go to{" "}
192+
<Link
193+
to="/about"
194+
style={{
195+
textDecoration: "none",
196+
color: "#6db33f",
197+
fontWeight: "bold",
198+
}}>
199+
About Page
200+
</Link>
201+
</div>
202+
189203
</div>
190204
</div>
191205
);

springqpro-frontend/src/pages/ProcessingMonitorPage.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* ProcessingMonitorPage.tsx:
2+
-----------------------------
3+
This is a live operational runtime monitor.
4+
*/
15
import { useEffect, useState } from "react";
26
import NavBar from "../components/NavBar";
37
import { useAuth } from "../utility/auth/AuthContext";

springqpro-frontend/src/pages/RegisterPage.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,20 @@ export default function RegisterPage() {
278278
Sign in →
279279
</Link>
280280
</div>
281+
282+
<div>
283+
Go to{" "}
284+
<Link
285+
to="/about"
286+
style={{
287+
textDecoration: "none",
288+
color: "#6db33f",
289+
fontWeight: "bold",
290+
}}>
291+
About Page
292+
</Link>
293+
</div>
294+
281295
</div>
282296
</div>
283297
);

springqpro-frontend/src/pages/SystemHealthPage.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* SystemHealthPage.tsx:
2+
------------------------
3+
4+
5+
*/
16
import { useEffect, useState } from "react";
27
import NavBar from "../components/NavBar";
38
import { useAuth } from "../utility/auth/AuthContext";

0 commit comments

Comments
 (0)