From d5c9887acbe2e907e9bcc43f41238113b4a18831 Mon Sep 17 00:00:00 2001 From: Artemy Date: Wed, 9 Aug 2023 18:02:45 +0300 Subject: [PATCH] feat: navbar --- src/App.tsx | 5 ++- src/components/navbar.tsx | 78 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/components/navbar.tsx diff --git a/src/App.tsx b/src/App.tsx index 6d92040..c8ae364 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,6 +4,7 @@ import { NextUIProvider } from "@nextui-org/react"; import { PipedAPI } from "piped-api"; import { BrowserRouter, Route, Routes } from "react-router-dom"; import Trending from "./pages/trending"; +import { NavbarComponent } from "./components/navbar"; declare global { interface Window { @@ -16,8 +17,10 @@ function App() { return ( + - } /> + } /> + } /> diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx new file mode 100644 index 0000000..133b46b --- /dev/null +++ b/src/components/navbar.tsx @@ -0,0 +1,78 @@ +import { MagnifyingGlassIcon } from "@heroicons/react/24/solid"; +import { + Navbar, + NavbarBrand, + NavbarContent, + NavbarItem, + NavbarMenuToggle, + NavbarMenu, + NavbarMenuItem, + Input, +} from "@nextui-org/react"; +import { Link } from "react-router-dom"; + +export function NavbarComponent() { + return ( + + + + + + ULTYT + + + + + + + } + /> + + + + + + ); +} + +function genMenu(menu: boolean) { + let NavItem, Nav; + + if (menu) { + NavItem = NavbarMenuItem; + Nav = NavbarMenu; + } else { + NavItem = NavbarItem; + Nav = NavbarContent; + } + + return ( + + ); +} + +function Menu() { + return ( + <> + {genMenu(false)} + {genMenu(true)} + + ); +}