From 18550bae212020ccab51f6eed47d71053a69fd64 Mon Sep 17 00:00:00 2001 From: Hh440 Date: Thu, 10 Oct 2024 19:30:41 +0530 Subject: [PATCH] NAvigation addtion --- frontend/package-lock.json | 2 +- frontend/src/App.tsx | 3 +- frontend/src/appComponents/About.tsx | 18 ++-- frontend/src/appComponents/Navdar.tsx | 118 ++++++++++++++++++++++++-- 4 files changed, 126 insertions(+), 15 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index cbe1cef..9cc81df 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -19,8 +19,8 @@ "canvas-confetti": "^1.9.3", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", - "framer-motion": "^11.11.7", "dypcetclubs": "file:", + "framer-motion": "^11.11.7", "lucide-react": "^0.419.0", "radix-ui": "^1.0.1", "react": "^18.3.1", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2c55632..43ad556 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { Route, Routes, BrowserRouter as Router, Outlet } from "react-router-dom"; -import Navbar from "./appComponents/Navdar"; +import { Navbar } from "./appComponents/Navdar"; import Hero from "./appComponents/Herosection"; import Clubs from "./appComponents/Clubs"; import Particles from "@/components/magicui/particles"; @@ -26,6 +26,7 @@ function App() { return ( + { @@ -19,12 +21,12 @@ const About =()=>{ setEmail('') } return( -
+
-
-
-
-

Welcome to DYPCET Clubs

+
+
+
+

Discover DYPCET Clubs

Where Passion Meets Purpose

+ + + + + +
diff --git a/frontend/src/appComponents/Navdar.tsx b/frontend/src/appComponents/Navdar.tsx index 3e84d1e..a620a01 100644 --- a/frontend/src/appComponents/Navdar.tsx +++ b/frontend/src/appComponents/Navdar.tsx @@ -1,12 +1,18 @@ import logo from "../assets/dypLogo.png"; +import { Dock, DockIcon } from "@/components/magicui/dock"; +import cross from "../assets/cross-icon.svg"; +import burger from "../assets/burger-menu.svg"; +import { useNavigate } from "react-router-dom"; +import { useState } from "react"; export type IconProps = React.HTMLAttributes; +// Navbar component const Navbar: React.FC = ({ setShowLoginPage }) => { return ( -
- {/* image-logo */} -
+
+ {/* Logo and Title at top-left corner */} +
Logo = ({ setShowLoginPage }) => { dypcetclubs.live
+ + {/* Club login button */}
{ - setShowLoginPage(true); - }} - className="mr-[15vw] lg:mr-0 text-base rounded-md shadow-xl text-black bg-white border-white border p-2 font-semibold cursor-pointer hover:scale-105 transform transition-all duration-500 hover:bg-transparent hover:text-white" + onClick={() => setShowLoginPage(true)} + className="text-base rounded-md shadow-xl text-black bg-white border-white border p-2 font-semibold cursor-pointer hover:scale-105 transform transition-all duration-500 hover:bg-transparent hover:text-white" > Club login
@@ -28,4 +34,100 @@ const Navbar: React.FC = ({ setShowLoginPage }) => { ); }; -export default Navbar; +// Navigation component +const Navigation = () => { + const [isMenuOpen, setIsMenuOpen] = useState(false); + const navigate = useNavigate(); + + const toggleMenu = () => { + setIsMenuOpen(!isMenuOpen); + }; + + return ( +
+ {/* Logo and Title at top-left corner */} +
+ Logo +

+ dypcetclubs.live +

+
+ + {/* Dock for larger screens */} +
+ + +

navigate("/")}> + Home +

+
+ +

navigate("/clubs")}> + Clubs +

+
+ +

navigate("/events")}> + Events +

+
+ +

navigate("/hiring")}> + Hiring +

+
+ +

navigate("/about")}> + About +

+
+
+
+ + {/* Mobile menu toggle button */} +
+ +
+ + {/* Mobile menu */} + {isMenuOpen && ( +
+ + +
    +
  • { navigate("/"); toggleMenu(); }} className="hover:underline cursor-pointer text-center">Home
  • +
  • { navigate("/clubs"); toggleMenu(); }} className="hover:underline cursor-pointer text-center">Clubs
  • +
  • { navigate("/events"); toggleMenu(); }} className="hover:underline cursor-pointer text-center">Events
  • +
  • { navigate("/hiring"); toggleMenu(); }} className="hover:underline cursor-pointer text-center">Hiring
  • +
  • { navigate("/about"); toggleMenu(); }} className="hover:underline cursor-pointer text-center">About
  • +
+
+ )} +
+ ); +}; + +export { Navbar, Navigation };