diff --git a/frontend/nextjs/package.json b/frontend/nextjs/package.json index 382d583..ee2409e 100644 --- a/frontend/nextjs/package.json +++ b/frontend/nextjs/package.json @@ -13,6 +13,7 @@ "@hookform/resolvers": "^3.3.2", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", + "@radix-ui/react-popover": "^1.0.7", "@radix-ui/react-scroll-area": "^1.0.5", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", diff --git a/frontend/nextjs/src/app/dapp/_components/navbar.tsx b/frontend/nextjs/src/app/dapp/_components/navbar.tsx new file mode 100644 index 0000000..762ccc3 --- /dev/null +++ b/frontend/nextjs/src/app/dapp/_components/navbar.tsx @@ -0,0 +1,111 @@ +"use client" +import React, { useState } from 'react' +import { Button } from '@/components/ui/button' +import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover' +import { ConnectButton } from '@rainbow-me/rainbowkit' +import { Search } from '@/components/ui/forms/search'; +import { HiMagnifyingGlass, HiBars3, HiOutlinePencilSquare } from 'react-icons/hi2' +import { X } from "lucide-react" +import Link from 'next/link' +import { CREATE_A_POST_PAGE, primaryNavigationLinks, resourcesLinks, hasBackButtonList, } from "./page-links" + +export const Navbar = () => { + const [showSearch, setShowSearch] = useState(false) + const [isLoggedIn, setIsLoggedIn] = useState(false) + + return ( + <> +
+
+
+

MEMM!

+
+
+ +
+ {showSearch && } + {showSearch ? <> + + + + : <> + + +
+ +
+
+ + + + + + +
+
+
+ {primaryNavigationLinks.map((link, key) => ( + + ))} +
+ {isLoggedIn ? : } +
+ +
+

+ Resources +

+
+ {resourcesLinks.map((link, key) => ( + + ))} +
+
+
+
+
+
+ + } +
+
+
+
+ + ) +} \ No newline at end of file diff --git a/frontend/nextjs/src/app/dapp/_components/page-links.ts b/frontend/nextjs/src/app/dapp/_components/page-links.ts index 5436881..ab90252 100644 --- a/frontend/nextjs/src/app/dapp/_components/page-links.ts +++ b/frontend/nextjs/src/app/dapp/_components/page-links.ts @@ -1,3 +1,5 @@ +import {HiOutlineHome, HiOutlineUser, HiOutlineUsers, HiOutlineCalendarDays, HiOutlineEnvelope } from 'react-icons/hi2' + export const CREATE_A_POST_PAGE = "/dapp/p/create" export const POST_PAGE = (permalink:string) => `/dapp/p/${permalink}` export const PROFILE_EDIT_PAGE = "/dapp/profile/edit" @@ -10,4 +12,61 @@ export const NOTIFICATIONS_PAGE = "/dapp/notifications" export const WELCOME_PAGE = "/welcome" export const FAQ_PAGE = "/faq" export const HELP_PAGE = "/help" -export const PRIVACY_POLICY_PAGE = "/privacy-policy" \ No newline at end of file +export const PRIVACY_POLICY_PAGE = "/privacy-policy" + +export const primaryNavigationLinks = [ + { + title: "Home", + icon: HiOutlineHome, + isActive: false, + href: HOME_PAGE + }, + { + title: "Marketplace", + icon: HiOutlineUsers, + isActive: false, + href: MARKETPLACE_PAGE + }, + { + title: "Bookings", + icon: HiOutlineCalendarDays, + isActive: false, + href: BOOKINGS_PAGE + }, + { + title: "My Profile", + icon: HiOutlineUser, + isActive: false, + href: PROFILE_PAGE + }, + { + title: "Notifications", + icon: HiOutlineEnvelope, + isActive: false, + href: NOTIFICATIONS_PAGE + } +] + +export const resourcesLinks = [ + { + title: "Welcome", + href: WELCOME_PAGE + }, + { + title: "FAQ", + href: FAQ_PAGE + }, + { + title: "Help", + href: HELP_PAGE + }, + { + title: "Privacy Policy", + href: PRIVACY_POLICY_PAGE + }, +] + +export const hasBackButtonList = [ + PROFILE_EDIT_PAGE, + CREATE_A_POST_PAGE +] \ No newline at end of file diff --git a/frontend/nextjs/src/app/dapp/_components/sidebar.tsx b/frontend/nextjs/src/app/dapp/_components/sidebar.tsx index 628b795..9449fd6 100644 --- a/frontend/nextjs/src/app/dapp/_components/sidebar.tsx +++ b/frontend/nextjs/src/app/dapp/_components/sidebar.tsx @@ -4,72 +4,14 @@ import Link from "next/link" import { usePathname } from 'next/navigation' import { cn } from "@/lib/utils" import { Button } from "@/components/ui/button" -import {HiOutlineHome, HiOutlineUser, HiOutlineUsers, HiOutlineCalendarDays, HiOutlineEnvelope, HiChevronLeft} from 'react-icons/hi2' -import { HOME_PAGE, MARKETPLACE_PAGE, BOOKINGS_PAGE, PROFILE_PAGE, NOTIFICATIONS_PAGE, PROFILE_EDIT_PAGE, CREATE_A_POST_PAGE, WELCOME_PAGE, FAQ_PAGE, HELP_PAGE, PRIVACY_POLICY_PAGE } from "./page-links" +import { HiChevronLeft} from 'react-icons/hi2' +import { HOME_PAGE, CREATE_A_POST_PAGE, primaryNavigationLinks, resourcesLinks, hasBackButtonList, } from "./page-links" interface SidebarProps extends React.HTMLAttributes { } -const primaryNavigationLinks = [ - { - title: "Home", - icon: HiOutlineHome, - isActive: false, - href: HOME_PAGE - }, - { - title: "Marketplace", - icon: HiOutlineUsers, - isActive: false, - href: MARKETPLACE_PAGE - }, - { - title: "Bookings", - icon: HiOutlineCalendarDays, - isActive: false, - href: BOOKINGS_PAGE - }, - { - title: "My Profile", - icon: HiOutlineUser, - isActive: false, - href: PROFILE_PAGE - }, - { - title: "Notifications", - icon: HiOutlineEnvelope, - isActive: false, - href: NOTIFICATIONS_PAGE - } -] - -const resourcesLinks = [ - { - title: "Welcome", - href: WELCOME_PAGE - }, - { - title: "FAQ", - href: FAQ_PAGE - }, - { - title: "Help", - href: HELP_PAGE - }, - { - title: "Privacy Policy", - href: PRIVACY_POLICY_PAGE - }, -] - -const hasBackButtonList = [ - PROFILE_EDIT_PAGE, - CREATE_A_POST_PAGE -] - - export function Sidebar({ className }: SidebarProps) { const [hasBackButton, setHasBackButton] = useState(false) const pathname = usePathname() @@ -109,10 +51,10 @@ export function Sidebar({ className }: SidebarProps) {
-

- Resources -

-
+

+ Resources +

+
{resourcesLinks.map((link, key) => ( ))} -
+
diff --git a/frontend/nextjs/src/app/dapp/layout.tsx b/frontend/nextjs/src/app/dapp/layout.tsx index c08e2bb..987165e 100644 --- a/frontend/nextjs/src/app/dapp/layout.tsx +++ b/frontend/nextjs/src/app/dapp/layout.tsx @@ -1,18 +1,18 @@ -import React from 'react'; +import React, {useState} from 'react'; import { Metadata } from 'next' import '@rainbow-me/rainbowkit/styles.css'; import { ConnectButton } from '@rainbow-me/rainbowkit'; import { Sidebar } from './_components/sidebar'; -import { RightSidebar } from './_components/right-sidebar'; -import { Search } from '@/components/ui/forms/search'; import { Button } from '@/components/ui/button'; import { HiOutlinePencilAlt } from "react-icons/hi" +import { HiBars3, HiMagnifyingGlass } from "react-icons/hi2" import DappProviders from './_components/providers'; import SessionProvider from "@/lib/hooks/sessionProvider"; import { getServerSession } from "next-auth"; +import {Navbar} from "./_components/navbar" export const metadata: Metadata = { title: 'MEMM! Homepage', @@ -26,32 +26,12 @@ export default async function DappLayout({ children }: Props) { const session = await getServerSession(); + return ( <> -
-
-
-

MEMM!

-
- - - -
-
-
-
+
diff --git a/frontend/nextjs/src/components/ui/popover.tsx b/frontend/nextjs/src/components/ui/popover.tsx new file mode 100644 index 0000000..a0ec48b --- /dev/null +++ b/frontend/nextjs/src/components/ui/popover.tsx @@ -0,0 +1,31 @@ +"use client" + +import * as React from "react" +import * as PopoverPrimitive from "@radix-ui/react-popover" + +import { cn } from "@/lib/utils" + +const Popover = PopoverPrimitive.Root + +const PopoverTrigger = PopoverPrimitive.Trigger + +const PopoverContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( + + + +)) +PopoverContent.displayName = PopoverPrimitive.Content.displayName + +export { Popover, PopoverTrigger, PopoverContent }