From c351f9aadd2e8b7ce93040b8da8911150970f5d7 Mon Sep 17 00:00:00 2001 From: vyshnav Date: Sat, 28 Sep 2024 16:13:43 +0530 Subject: [PATCH] Add admin navbar component --- src/components/Admin/Navbar/navbar.tsx | 177 +++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 src/components/Admin/Navbar/navbar.tsx diff --git a/src/components/Admin/Navbar/navbar.tsx b/src/components/Admin/Navbar/navbar.tsx new file mode 100644 index 0000000..438bbaf --- /dev/null +++ b/src/components/Admin/Navbar/navbar.tsx @@ -0,0 +1,177 @@ +"use client"; +import React, { Dispatch, SetStateAction, useState } from "react"; +import { IconType } from "react-icons"; +import { FiChevronDown, FiChevronsRight, FiUser } from "react-icons/fi"; +import { RiCoupon3Line } from "react-icons/ri"; +import { motion } from "framer-motion"; +import Link from "next/link"; +import Image from "next/image"; + +export const AdminNavbar = () => { + return ( +
+ + +
+ ); +}; + +const Sidebar = () => { + const [open, setOpen] = useState(true); + const [selected, setSelected] = useState("Dashboard"); + + return ( + + + +
+
+ + +
+ ); +}; + +const Option = ({ + Icon, + title, + selected, + setSelected, + open, + notifs, + href, +}: { + Icon: IconType; + title: string; + selected: string; + setSelected: Dispatch>; + open: boolean; + notifs?: number; + href?: string; +}) => { + return ( + + setSelected(title)} + className={`relative flex h-10 w-full items-center rounded-md transition-colors ${ + selected === title ? "bg-indigo-100 text-indigo-800" : "text-slate-500 hover:bg-slate-100" + }`} + > + + + + {open && ( + + {title} + + )} + + {notifs && open && ( + + {notifs} + + )} + + + ); +}; + +const TitleSection = ({ open }: { open: boolean }) => { + return ( +
+
+
+ + {open && ( + + Tedxsjec + Admin Page + + )} +
+ {open && } +
+
+ ); +}; + +const Logo = () => { + // Temp logo from https://logoipsum.com/ + return ( + + logo + + ); +}; + +const ToggleClose = ({ open, setOpen }: { open: boolean; setOpen: Dispatch> }) => { + return ( + setOpen((pv) => !pv)} + className="absolute bottom-0 left-0 right-0 border-t border-slate-300 transition-colors hover:bg-slate-100" + > +
+ + + + {open && ( + + Hide + + )} +
+
+ ); +}; + +const NavbarContent = () =>
;