diff --git a/client/src/Components/Header.jsx b/client/src/Components/Header.jsx index e41bd50..65cef30 100644 --- a/client/src/Components/Header.jsx +++ b/client/src/Components/Header.jsx @@ -1,57 +1,217 @@ -import React from "react"; -import { Link } from "react-router-dom"; +// import React from "react"; import { useAuth0 } from "@auth0/auth0-react"; import { useCart } from "../utils/CartContext"; -import { useNavigate } from "react-router-dom"; +import { useNavigate, Link } from "react-router-dom"; import { toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import Logo from "./Logo"; -const Header = () => { +// const Header = () => { +// const { loginWithRedirect, isAuthenticated, logout, user } = useAuth0(); +// const { cartItems } = useCart(); +// const navigate = useNavigate(); +// const isTrue = true; // Variable to temporarily store true value + +// // Function to navigate to the cart page if logged in, show prompt if not +// const handleCartClick = () => { +// if (isTrue) { //Change to isAuthenticated to enable authentication +// navigate("/cart"); +// } else { +// toast.error("Please log in to access the cart.", { +// position: toast.POSITION.TOP_CENTER, +// autoClose: 3000, +// hideProgressBar: true, +// closeButton: false, +// }); +// } +// }; + +// return ( +//
+//
+// {/* Brand Logo as a Link with Bounce Animation */} +// +// +// +//
+// {/* Display user name if authenticated */} +// {isAuthenticated && ( +// +// Hello, {user.name} +// +// )} + +// {/* Navigation */} +// + +//
+//
+//
+// ); +// }; + +// export default Header; +import { useState } from 'react'; +import { Menu, Search, Book, User, ShoppingCart, Home, Settings } from 'lucide-react'; +const handleHomeClick = () => { + navigate("./Header.jsx"); +}; + +// Function to navigate to the catalog page +const handleCatalogClick = () => { + navigate("./Blog"); +}; + + +const NavigationBar = () => { const { loginWithRedirect, isAuthenticated, logout, user } = useAuth0(); const { cartItems } = useCart(); - const navigate = useNavigate(); - const isTrue = true; // Variable to temporarily store true value - - // Function to navigate to the cart page if logged in, show prompt if not - const handleCartClick = () => { - if (isTrue) { //Change to isAuthenticated to enable authentication - navigate("/cart"); - } else { - toast.error("Please log in to access the cart.", { - position: toast.POSITION.TOP_CENTER, - autoClose: 3000, - hideProgressBar: true, - closeButton: false, - }); - } - }; + + + + + // const { cartItems } = useCart(); + // const { loginWithRedirect } = useAuth0(); + // const { isAuthenticated, user, logout } = useAuth0(); + const [isMenuOpen, setIsMenuOpen] = useState(false); + // Function to navigate to the cart page if logged in, show prompt if not return ( -
-
- {/* Brand Logo as a Link with Bounce Animation */} - - - +
+ {/* Main Navigation Bar */} + + - {/* Cart Button with Hover Animation */} - - - -
-
-
+ {/* Mobile Menu */} + {isMenuOpen && ( +
+
+ + Home + + + Catalog + + + Advanced Search + +
+
+ )} + ); }; -export default Header; +export default NavigationBar; \ No newline at end of file