Changeset 4022db1 for frontend/src
- Timestamp:
- 01/26/26 17:02:31 (6 months ago)
- Branches:
- main
- Children:
- 3727852
- Parents:
- 24a2a2a
- Location:
- frontend/src
- Files:
-
- 1 added
- 3 edited
-
Login.tsx (modified) (1 diff)
-
Nav.tsx (modified) (5 diffs)
-
Register.tsx (modified) (3 diffs)
-
assets/logo-finkwave.png (added)
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Login.tsx
r24a2a2a r4022db1 32 32 }; 33 33 return ( 34 <div className="flex flex-col items-center justify-center min-h- screenbg-gray-100">34 <div className="flex flex-col items-center justify-center min-h-[90vh] bg-gray-100"> 35 35 <h2 className="text-2xl mb-4">Login</h2> 36 36 <form -
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> -
frontend/src/Register.tsx
r24a2a2a r4022db1 6 6 7 7 const Register = () => { 8 const { setUser , user} = useAuth();8 const { setUser } = useAuth(); 9 9 const [username, setUsername] = useState(""); 10 10 const [password, setPassword] = useState(""); … … 45 45 46 46 return ( 47 <div className="flex flex-col items-center justify-center min-h- screenbg-gray-100">47 <div className="flex flex-col items-center justify-center min-h-[90vh] bg-gray-100"> 48 48 <h2 className="text-2xl mb-4">Register</h2> 49 49 <form className="bg-white p-6 rounded shadow-md w-80"> … … 101 101 </label> 102 102 <input 103 placeholder="todo" 103 104 type="text" 104 105 id="profilePhoto"
Note:
See TracChangeset
for help on using the changeset viewer.
