added menu and icons

This commit is contained in:
2024-06-07 19:22:57 -04:00
parent 936993ddb5
commit a1647293db
6 changed files with 2645 additions and 3108 deletions
+145 -3
View File
@@ -1,12 +1,154 @@
"use client";
import Image from "next/image";
import React from "react";
import React, { useState } from "react";
import { Button } from "../ui/button";
import { cn } from "@/lib/utils";
import {
ArrowLeftRightIcon,
ArrowLeftToLineIcon,
ArrowRightToLine,
ArrowRightToLineIcon,
CalendarIcon,
CircleDollarSignIcon,
FileTextIcon,
LayoutGridIcon,
LineChartIcon,
LogOutIcon,
Mail,
PersonStanding,
PersonStandingIcon,
RocketIcon,
Settings,
} from "lucide-react";
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from "../ui/command";
function Sidebar() {
const [isCollapsed, setIsCollapsed] = useState<boolean>(false);
const menuList = [
{
group: "Navigation",
items: [
{
link: "/dashboard",
icon: <LayoutGridIcon />,
text: "Dashboard",
},
{
link: "/calendar",
icon: <CalendarIcon />,
text: "Calendar",
},
{
link: "/porfolio",
icon: <LineChartIcon />,
text: "Portfolio",
},
],
},
{
group: "Apple Inc",
items: [
{
link: "/",
icon: <CircleDollarSignIcon />,
text: "Earnings",
},
{
link: "/",
icon: <ArrowLeftRightIcon />,
text: "Insider Trades",
},
{
link: "/",
icon: <FileTextIcon />,
text: "Filings",
},
],
},
];
return (
<div className="w-[275px] border-r border-neutral-700 min-h-screen p-4 fixed">
{/* <Image src={"/yellowbird.svg"} height={10} width={120} alt="yellowbird" /> */}
<div
className={cn(
isCollapsed ? "w-[75px]" : "min-w-[300px]",
"border-r border-neutral-700 min-h-screen"
)}
>
<div className="flex flex-col min-h-screen p-4">
<div className="h-12 pt-1 flex justify-center bg-primary rounded-full">
<Image
src={"/yellowbird-black.svg"}
height={10}
width={120}
alt="yellowbird"
/>
</div>
<Command className="pt-4 rounded-lg bg-background flex-grow">
<CommandList className="max-h-full">
{menuList.map((menu: any, key: number) => (
<CommandGroup heading={!isCollapsed && menu.group} key={key}>
{menu.items.map((option: any, optionKey: number) => (
<CommandItem
key={optionKey}
className="flex gap-2 cursor-pointer p-2"
>
{option.icon}
{!isCollapsed && (
<span className="text-base">{option.text}</span>
)}
</CommandItem>
))}
</CommandGroup>
))}
</CommandList>
</Command>
<Button
variant="ghost"
onClick={() => {
setIsCollapsed(!isCollapsed);
}}
>
{!isCollapsed ? (
<ArrowLeftToLineIcon height={20} />
) : (
<ArrowRightToLineIcon height={20} />
)}
</Button>
<div
className={cn(
!isCollapsed ? "p-2" : "p-0",
"border border-neutral-700 rounded-lg flex"
)}
>
<Button variant="default" className="w-10 h-10">
Me
</Button>
{!isCollapsed && (
<>
<div className="flex-grow pl-2">
<p className="text-sm">Dylan Benzi</p>
<p className="text-xs text-muted-foreground">
dylanbenzi@gmail.com
</p>
</div>
<Button variant="ghost" className="">
<LogOutIcon width={20} height={20} className="text-red-500" />
</Button>
</>
)}
</div>
</div>
</div>
);
}