Changeset 4022db1 for frontend/src/Nav.tsx
- Timestamp:
- 01/26/26 17:02:31 (6 months ago)
- Branches:
- main
- Children:
- 3727852
- Parents:
- 24a2a2a
- File:
-
- 1 edited
-
frontend/src/Nav.tsx (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Nav.tsx
r24a2a2a r4022db1 1 1 import { Link } from "react-router-dom"; 2 2 import axiosInstance from "./api/axiosInstance"; 3 import Logo from "./assets/logo-finkwave.png"; 3 4 import { useAuth } from "./context/authContext"; 4 5 … … 6 7 const { user, setUser, isAuthLoading } = useAuth(); 7 8 8 const handleLogout = async () => { 9 const handleLogout = async (e: React.MouseEvent<HTMLButtonElement>) => { 10 e.preventDefault(); 9 11 try { 10 12 await axiosInstance.post("/auth/logout"); … … 18 20 <div className="bg-gray-800 p-4 flex justify-between items-center"> 19 21 <Link to="/" className="text-white text-lg font-semibold"> 20 Finkwave22 <img src={Logo} alt="Finkwave Logo" className="h-12 w-auto" /> 21 23 </Link> 22 24 … … 40 42 </div> 41 43 <button 42 onClick={(e ) => {43 e.preventDefault();44 handleLogout();45 }}46 className="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors duration-200 flex items-center space-x-1"44 onClick={(e: React.MouseEvent<HTMLButtonElement>) => 45 handleLogout(e) 46 } 47 className="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg text-sm 48 font-medium transition-colors duration-200 flex items-center space-x-1 cursor-pointer" 47 49 > 48 50 Logout … … 50 52 </div> 51 53 ) : ( 52 <div className="flex items-center space-x- 2">54 <div className="flex items-center space-x-4"> 53 55 <Link 54 56 to="/login" 55 className="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors duration-200" 57 className="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg text-sm 58 font-medium transition-colors duration-200 cursor-pointer" 56 59 > 57 60 Login 61 </Link> 62 <Link 63 to="/register" 64 className="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg text-sm 65 font-medium transition-colors duration-200 cursor-pointer" 66 > 67 Register 58 68 </Link> 59 69 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
