Skip to content

Commit

Permalink
added signup and login optoins to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
tester committed Oct 7, 2024
1 parent ba5515f commit 63b5e61
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions frontend/src/components/MainNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const Navbar = () => {
const navigate = useNavigate();
const location = useLocation();
useEffect(() => {
console.log("here");
if (location.pathname === '/') navigate("/homepage");
}, [location]);
return (
Expand All @@ -20,9 +19,20 @@ const Navbar = () => {
<Link to="/homepage" className="text-gray-300 hover:text-white m-3">
Home
</Link>
<Link to="/login" className="text-gray-300 hover:text-white">
Login
</Link>
<select name="Registrer" id="">
<option onClick={() => {
navigate("/login");
}
}>
Login
</option>
<option onClick={() => {
navigate("/signup");
}
}>
Signup
</option>
</select>
<Link to="/posts" className="text-gray-300 hover:text-white">
post
</Link>
Expand Down

0 comments on commit 63b5e61

Please sign in to comment.