diff --git a/src/components/listItem.tsx b/src/components/listItem.tsx new file mode 100644 index 0000000..ca85cd5 --- /dev/null +++ b/src/components/listItem.tsx @@ -0,0 +1,28 @@ +import { NavigationMenuLink } from "@/components/ui/navigation-menu"; +import { cn } from "@/lib/utils"; +import React from "react"; +const ListItem = React.forwardRef, React.ComponentPropsWithoutRef<"a">>( + ({ className, title, children, ...props }, ref) => { + return ( +
  • + + +
    {title}
    +
    +

    {children}

    +
    +
    +
  • + ); + } +); +ListItem.displayName = "ListItem"; + +export default ListItem; diff --git a/src/components/mobileMenu.tsx b/src/components/mobileMenu.tsx deleted file mode 100644 index 9c513a8..0000000 --- a/src/components/mobileMenu.tsx +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; -import { useState } from "react"; -import { Menu, X } from "lucide-react"; -import { Button } from "./ui/button"; -import { motion } from "framer-motion"; - -export function MobileMenu() { - const [isVisible, setIsVisible] = useState(false); - return ( -
    - - {isVisible && ( - - setIsVisible(false)} /> - - )} -
    - ); -} diff --git a/src/components/navigationBar/menu.ts b/src/components/navigationBar/menu.ts new file mode 100644 index 0000000..d7ad987 --- /dev/null +++ b/src/components/navigationBar/menu.ts @@ -0,0 +1,23 @@ +export const businessComponents = [ + { + title: "Business", + href: "/business/apply", + description: "Apply to raise on on B2DVentures", + }, +]; + +export const projectComponents = [ + { + title: "Projects", + href: "/project/apply", + description: "Start your new project on B2DVentures", + }, +]; + +export const dataroomComponents = [ + { + title: "Overview", + href: "/dataroom/overview", + description: "View all dataroom available to you", + }, +]; diff --git a/src/components/navigationBar/mobileMenu.tsx b/src/components/navigationBar/mobileMenu.tsx new file mode 100644 index 0000000..60e2e41 --- /dev/null +++ b/src/components/navigationBar/mobileMenu.tsx @@ -0,0 +1,81 @@ +"use client"; +import { useState } from "react"; +import { Menu, X } from "lucide-react"; +import { Button } from "../ui/button"; +import { motion } from "framer-motion"; +import { + NavigationMenu, + NavigationMenuContent, + NavigationMenuItem, + NavigationMenuLink, + NavigationMenuList, + NavigationMenuTrigger, +} from "@/components/ui/navigation-menu"; +import React from "react"; +import { SearchBar } from "./serchBar"; +import ListItem from "../listItem"; +import { businessComponents, projectComponents, dataroomComponents } from "./menu"; + +export function MobileMenu() { + const [isVisible, setIsVisible] = useState(false); + return ( +
    + + {isVisible && ( + + setIsVisible(false)} /> + + + + Businesses + + {businessComponents.map((component) => ( + + {component.description} + + ))} + + + + Projects + +
      + {projectComponents.map((component) => ( + + {component.description} + + ))} +
    +
    +
    + + Dataroom + +
      + {dataroomComponents.map((component) => ( + + {component.description} + + ))} +
    +
    +
    + + + + +
    +
    +
    + )} +
    + ); +} diff --git a/src/components/navigationBar/nav.tsx b/src/components/navigationBar/nav.tsx index e4f0233..8771a23 100644 --- a/src/components/navigationBar/nav.tsx +++ b/src/components/navigationBar/nav.tsx @@ -2,7 +2,6 @@ import * as React from "react"; import Link from "next/link"; import Image from "next/image"; -import { cn } from "@/lib/utils"; import { Separator } from "@/components/ui/separator"; import { ThemeToggle } from "@/components/theme-toggle"; import { @@ -21,31 +20,9 @@ import { createSupabaseClient } from "@/lib/supabase/serverComponentClient"; import { getUserId } from "@/lib/supabase/actions/getUserId"; import { getUnreadNotificationCountByUserId } from "@/lib/data/notificationQuery"; -import { MobileMenu } from "../mobileMenu"; - -const ListItem = React.forwardRef, React.ComponentPropsWithoutRef<"a">>( - ({ className, title, children, ...props }, ref) => { - return ( -
  • - - -
    {title}
    -
    -

    {children}

    -
    -
    -
  • - ); - } -); -ListItem.displayName = "ListItem"; +import { MobileMenu } from "./mobileMenu"; +import ListItem from "../listItem"; +import { businessComponents, projectComponents, dataroomComponents } from "./menu"; export async function NavigationBar() { const client = createSupabaseClient(); @@ -59,30 +36,6 @@ export async function NavigationBar() { notification_count = 0; } - const businessComponents = [ - { - title: "Business", - href: "/business/apply", - description: "Apply to raise on on B2DVentures", - }, - ]; - - const projectComponents = [ - { - title: "Projects", - href: "/project/apply", - description: "Start your new project on B2DVentures", - }, - ]; - - const dataroomComponents = [ - { - title: "Overview", - href: "/dataroom/overview", - description: "View all dataroom available to you", - }, - ]; - return (