more style, mostly of w3 compliance
Some checks are pending
check / check (push) Waiting to run

This commit is contained in:
KS Jannette
2026-03-01 02:05:36 -05:00
parent 7357315810
commit 112c9d0627
9 changed files with 157 additions and 77 deletions

View File

@@ -1,5 +1,6 @@
import { Routes, Route, Link, Navigate } from "react-router-dom";
import { Routes, Route, Navigate } from "react-router-dom";
import { useAuth } from "./contexts/AuthContext";
import Navbar from "./components/Navbar";
import Login from "./pages/Login";
import Signup from "./pages/Signup";
import Addresses from "./pages/Addresses";
@@ -7,9 +8,8 @@ import Alerts from "./pages/Alerts";
import AlertHistory from "./pages/AlertHistory";
export default function App() {
const { currentUser, logout } = useAuth();
const { currentUser } = useAuth();
// Show login/signup routes if not authenticated
if (!currentUser) {
return (
<Routes>
@@ -20,51 +20,9 @@ export default function App() {
);
}
// Show main app if authenticated
return (
<div style={{ padding: "1rem" }}>
<nav
style={{
marginBottom: "1rem",
display: "flex",
justifyContent: "space-between",
alignItems: "center",
}}
>
<div>
<Link to="/addresses">Addresses</Link>
{" | "}
<Link to="/alerts">Alerts</Link>
{" | "}
<Link to="/history">History</Link>
</div>
<div
style={{
display: "flex",
alignItems: "center",
gap: "1rem",
}}
>
<span style={{ fontSize: "0.9rem", color: "#999" }}>
{currentUser.email}
</span>
<button
onClick={logout}
style={{
padding: "0.5rem 1rem",
fontSize: "0.9rem",
backgroundColor: "#333",
color: "white",
border: "1px solid #555",
borderRadius: "4px",
cursor: "pointer",
}}
>
Logout
</button>
</div>
</nav>
<div>
<Navbar />
<Routes>
<Route path="/" element={<Addresses />} />
<Route path="/addresses" element={<Addresses />} />