no separate login/register page, use modal throughout

This commit is contained in:
jackiettran
2025-10-10 15:26:07 -04:00
parent 0a9b875a9d
commit 462dbf6b7a
12 changed files with 125 additions and 296 deletions

View File

@@ -1,15 +1,10 @@
import React, { useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { useAuth } from "../contexts/AuthContext";
import AuthModal from "./AuthModal";
const Navbar: React.FC = () => {
const { user, logout } = useAuth();
const { user, logout, openAuthModal } = useAuth();
const navigate = useNavigate();
const [showAuthModal, setShowAuthModal] = useState(false);
const [authModalMode, setAuthModalMode] = useState<"login" | "signup">(
"login"
);
const [searchFilters, setSearchFilters] = useState({
search: "",
location: "",
@@ -20,11 +15,6 @@ const Navbar: React.FC = () => {
navigate("/");
};
const openAuthModal = (mode: "login" | "signup") => {
setAuthModalMode(mode);
setShowAuthModal(true);
};
const handleSearch = (e: React.FormEvent) => {
e.preventDefault();
const params = new URLSearchParams();
@@ -204,12 +194,6 @@ const Navbar: React.FC = () => {
</div>
</div>
</nav>
<AuthModal
show={showAuthModal}
onHide={() => setShowAuthModal(false)}
initialMode={authModalMode}
/>
</>
);
};