diff --git a/Frontend/src/pages/nav.js b/Frontend/src/pages/nav.js index 7d5ad94..05e4f14 100644 --- a/Frontend/src/pages/nav.js +++ b/Frontend/src/pages/nav.js @@ -1,15 +1,16 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import Link from "next/link"; - - const NavBar = () => { + const [page, setPage] = useState("portfolio"); + const handleLogout = () => { // Set the 'token' cookie to expire immediately, effectively logging the user out document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;"; - + }; - + const handlePage = (page) => { + setPage(page); }; return ( @@ -30,22 +31,22 @@ const NavBar = () => { {/* Primary Navbar items */}
- + handlePage("vote")} className={`py-4 px-2 ${page === "vote" ? "text-blue-400" : "text-gray-300"} font-semibold hover:text-blue-400 transition duration-300 cursor-pointer`}> Vote - + handlePage("portfolio")} className={`py-4 px-2 ${page === "portfolio" ? "text-blue-400" : "text-gray-300"} font-semibold hover:text-blue-400 transition duration-300 cursor-pointer`}> Portfolio - + handlePage("leaderboard")} className={`py-4 px-2 ${page === "leaderboard" ? "text-blue-400" : "text-gray-300"} font-semibold hover:text-blue-400 transition duration-300 cursor-pointer`}> Leaderboard - + handlePage("create")} className={`py-4 px-2 ${page === "create" ? "text-blue-400" : "text-gray-300"} font-semibold hover:text-blue-400 transition duration-300 cursor-pointer`}> Create diff --git a/Frontend/src/pages/portfolio.js b/Frontend/src/pages/portfolio.js index 95f129c..12cbd2a 100644 --- a/Frontend/src/pages/portfolio.js +++ b/Frontend/src/pages/portfolio.js @@ -82,7 +82,7 @@ export default function Portfolio() { width={500} height={500} /> -

"{selectedImage.prompt}"

+

"{selectedImage.prompt}"

)}