From 3d73fdff36804164c9304fcdce68e6dbb07fafbb Mon Sep 17 00:00:00 2001 From: aryansingh144 Date: Mon, 14 Oct 2024 13:26:22 +0530 Subject: [PATCH] Navbar completly fixed --- .env | 4 ++ src/app/components/Navbar.tsx | 117 +++++++++++++++++++++++++--------- 2 files changed, 91 insertions(+), 30 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..81c3310 --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ + NEXT_PUBLIC_SUPABASE_URL=https://twsbyjhyntfbcadywdkl.supabase.co + NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InR3c2J5amh5bnRmYmNhZHl3ZGtsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mjg4ODM1NTYsImV4cCI6MjA0NDQ1OTU1Nn0.2rTbjf9CLJObMq3hHuYG_dY03mywwTHEzBt0Jz8iflI + NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=youplay + NEXT_PUBLIC_CLOUDINARY_API_KEY=151273272649153 \ No newline at end of file diff --git a/src/app/components/Navbar.tsx b/src/app/components/Navbar.tsx index efc78bd..f2fdee4 100644 --- a/src/app/components/Navbar.tsx +++ b/src/app/components/Navbar.tsx @@ -1,39 +1,96 @@ -import React from 'react' +import React, { useState } from 'react'; import Image from 'next/image'; -import Logo from '../public/Logo.png' -import '@/styles.css' +import Logo from '../public/Logo.png'; +import '@/styles.css'; + const Navbar = () => { - const navItems = [ - { label: 'Home', id: 'home' }, - { label: 'Team', id: 'team' }, - { label: 'Projects', id: 'projects' }, - { label: 'Events', id: 'events' }, - { label: 'Notice', id: 'notice' }, - ]; + const [isOpen, setIsOpen] = useState(false); + + const navItems = [ + { label: 'Home', id: 'home' }, + { label: 'Team', id: 'team' }, + { label: 'Projects', id: 'projects' }, + { label: 'Events', id: 'events' }, + { label: 'Notice', id: 'notice' }, + ]; + return ( -
-
- Logo -
-
-
    - {navItems.map((item) => ( +
    +
    + Logo +
    +
    +
      + {navItems.map((item) => ( +
    • +
    • + ))} +
    +
    + +
    + +
    + {/* Mobile Menu */} + {isOpen && ( +
    +
      + {navItems.map((item) => ( +
    • + +
    • ))} -
    -
    -
    - Log In - Sign Up -
    -
    - ) -} +
+
+ + Log In + + + Sign Up + +
+
+ )} +
+ ); +}; -export default Navbar \ No newline at end of file +export default Navbar;