Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions frontend/src/components/shared/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,16 @@ export default function Navbar() {
return "U";
};

const LogoutButton = ({ className = "" }) => (
<button
type="button"
onClick={handleLogout}
className={`px-2 text-[11px] font-semibold uppercase tracking-[0.09em] text-zinc-400 hover:text-black transition-colors duration-150 ${className}`}
>
Logout
</button>
);

// ── Active link style ────────────────────────────────────────────────────
// font-semibold + thin underline instead of font-black + decoration-4
const isActive = (path) => location.pathname === path;
Expand Down Expand Up @@ -517,12 +527,7 @@ export default function Navbar() {
</Link>

{/* Logout β€” lowest visual weight, plain text */}
<button
onClick={handleLogout}
className="px-2 text-[11px] font-semibold uppercase tracking-[0.09em] text-zinc-400 hover:text-black transition-colors duration-150"
>
Logout
</button>
<LogoutButton />
</>
)}
</div>
Expand Down Expand Up @@ -735,12 +740,7 @@ export default function Navbar() {
GitHub Data <span className="text-zinc-300 text-sm">β†’</span>
</Link>

<button
onClick={handleLogout}
className="w-full px-5 py-3.5 text-[13px] font-semibold uppercase tracking-[0.09em] text-zinc-400 hover:text-black border-b border-zinc-100 hover:bg-zinc-50 transition-colors duration-150 text-left"
>
Logout
</button>
<LogoutButton className="w-full px-5 py-3.5 text-[13px] border-b border-zinc-100 hover:bg-zinc-50 text-left" />
</>
)}
</div>
Expand Down
16 changes: 2 additions & 14 deletions frontend/src/pages/DashboardPage.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { useState } from "react";
import { useAuth } from "../context/AuthContext";
import { useNavigate, Link } from "react-router-dom";
import { Link } from "react-router-dom";
import { useCodeforces } from "../hooks/useCodeforces";
import ConnectBanner from "../components/codeforces/ConnectBanner";
import VerifyModal from "../components/codeforces/VerifyModal";
import DashboardExecutiveSummary from "../components/dashboard/DashboardExecutiveSummary";
import LoaderSwitcher from "../components/shared/loaders/LoaderSwitcher";

export default function DashboardPage() {
const { user, loading, logout } = useAuth();
const navigate = useNavigate();
const { user, loading } = useAuth();
const [modalOpen, setModalOpen] = useState(false);

const {
Expand All @@ -23,11 +22,6 @@ export default function DashboardPage() {
connectError,
} = useCodeforces(true);

const handleLogout = async () => {
await logout(); // clears HttpOnly cookies server-side
navigate("/");
};

if (loading) {
return <LoaderSwitcher />;
}
Expand All @@ -44,12 +38,6 @@ export default function DashboardPage() {
Welcome back, {user?.name || "Engineer"}.
</p>
</div>
<button
onClick={handleLogout}
className="px-6 sm:px-8 py-3 sm:py-4 border-4 border-black bg-white text-black font-black uppercase tracking-widest hover:bg-black hover:text-white transition-colors rounded-none w-full md:w-auto"
>
Logout
</button>
</header>

{/* AI Executive Summary - The Hero of the Dashboard */}
Expand Down
Loading