From 3a4b178a2f65e38c6300eac7821c47cafbefa92a Mon Sep 17 00:00:00 2001
From: Arushi28-hub
Date: Fri, 12 Jun 2026 19:02:16 +0530
Subject: [PATCH] Fix duplicate logout button
---
frontend/src/components/shared/Navbar.jsx | 24 +++++++++++------------
frontend/src/pages/DashboardPage.jsx | 16 ++-------------
2 files changed, 14 insertions(+), 26 deletions(-)
diff --git a/frontend/src/components/shared/Navbar.jsx b/frontend/src/components/shared/Navbar.jsx
index bd70e86..9ee9622 100644
--- a/frontend/src/components/shared/Navbar.jsx
+++ b/frontend/src/components/shared/Navbar.jsx
@@ -346,6 +346,16 @@ export default function Navbar() {
return "U";
};
+ const LogoutButton = ({ className = "" }) => (
+
+ );
+
// ── Active link style ────────────────────────────────────────────────────
// font-semibold + thin underline instead of font-black + decoration-4
const isActive = (path) => location.pathname === path;
@@ -517,12 +527,7 @@ export default function Navbar() {
{/* Logout — lowest visual weight, plain text */}
-
+
>
)}
@@ -735,12 +740,7 @@ export default function Navbar() {
GitHub Data →
-
+
>
)}
diff --git a/frontend/src/pages/DashboardPage.jsx b/frontend/src/pages/DashboardPage.jsx
index 08c4a4b..fbeffa7 100644
--- a/frontend/src/pages/DashboardPage.jsx
+++ b/frontend/src/pages/DashboardPage.jsx
@@ -1,6 +1,6 @@
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";
@@ -8,8 +8,7 @@ import DashboardExecutiveSummary from "../components/dashboard/DashboardExecutiv
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 {
@@ -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 ;
}
@@ -44,12 +38,6 @@ export default function DashboardPage() {
Welcome back, {user?.name || "Engineer"}.
-
{/* AI Executive Summary - The Hero of the Dashboard */}