-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from JasimIhsan/frontend
feat: sidebar navigation done
- Loading branch information
Showing
2 changed files
with
76 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,80 @@ | ||
import { Calendar, Home, Inbox, Search, Settings } from "lucide-react"; | ||
import LightLogo from "../../../assets/Logo Light.svg" | ||
import DarkLogo from "../../../assets/Logo Dark.svg" | ||
|
||
import { | ||
Sidebar, | ||
SidebarContent, | ||
SidebarGroup, | ||
SidebarGroupContent, | ||
SidebarGroupLabel, | ||
SidebarHeader, | ||
SidebarMenu, | ||
SidebarMenuButton, | ||
SidebarMenuItem, | ||
} from "@/components/ui/sidebar"; | ||
import { UserRound, Newspaper, Search, SquareActivity, Plus } from "lucide-react"; | ||
import LightLogo from "../../../assets/Logo Light.svg"; | ||
import DarkLogo from "../../../assets/Logo Dark.svg"; | ||
import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from "@/components/ui/sidebar"; | ||
import { DropdownMenu, DropdownMenuTrigger } from "../../ui/dropdown-menu"; | ||
import Button from "@/components/ui/button"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const items = [ | ||
{ | ||
title: "Home", | ||
url: "#", | ||
icon: Home, | ||
}, | ||
{ | ||
title: "Inbox", | ||
url: "#", | ||
icon: Inbox, | ||
}, | ||
{ | ||
title: "Calendar", | ||
url: "#", | ||
icon: Calendar, | ||
}, | ||
{ | ||
title: "Search", | ||
url: "#", | ||
icon: Search, | ||
}, | ||
{ | ||
title: "Settings", | ||
url: "#", | ||
icon: Settings, | ||
}, | ||
{ | ||
title: "My feed", | ||
url: "/home", | ||
icon: Newspaper, | ||
}, | ||
{ | ||
title: "Explore", | ||
url: "/explore", | ||
icon: Search, | ||
}, | ||
{ | ||
title: "Activity", | ||
url: "/activity", | ||
icon: SquareActivity, | ||
}, | ||
{ | ||
title: "Profile", | ||
url: "/profile", | ||
icon: UserRound, | ||
}, | ||
]; | ||
|
||
export function AppSidebar() { | ||
return ( | ||
<Sidebar> | ||
<SidebarHeader> | ||
<SidebarMenu> | ||
<SidebarMenuItem> | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<SidebarMenuButton size="lg"> | ||
<div className="w-full flex justify-center items-center"> | ||
<img src={LightLogo} alt="" className="max-w-[100px] dark:hidden"/> | ||
<img src={DarkLogo} alt="" className="max-w-[100px] dark:block hidden"/> | ||
</div> | ||
</SidebarMenuButton> | ||
</DropdownMenuTrigger> | ||
</DropdownMenu> | ||
</SidebarMenuItem> | ||
</SidebarMenu> | ||
</SidebarHeader> | ||
<SidebarContent> | ||
<SidebarGroup> | ||
<SidebarGroupLabel>Application</SidebarGroupLabel> | ||
<SidebarGroupContent> | ||
<SidebarMenu> | ||
{items.map((item) => ( | ||
<SidebarMenuItem key={item.title}> | ||
<SidebarMenuButton asChild> | ||
<a href={item.url}> | ||
<item.icon /> | ||
<span>{item.title}</span> | ||
</a> | ||
</SidebarMenuButton> | ||
</SidebarMenuItem> | ||
))} | ||
</SidebarMenu> | ||
</SidebarGroupContent> | ||
</SidebarGroup> | ||
</SidebarContent> | ||
</Sidebar> | ||
); | ||
|
||
return ( | ||
<Sidebar> | ||
<SidebarHeader> | ||
<SidebarMenu> | ||
<SidebarMenuItem> | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<SidebarMenuButton size="lg"> | ||
<div className="w-full flex justify-center items-center"> | ||
<img src={LightLogo} alt="" className="max-w-[100px] dark:hidden" /> | ||
<img src={DarkLogo} alt="" className="max-w-[100px] dark:block hidden" /> | ||
</div> | ||
</SidebarMenuButton> | ||
</DropdownMenuTrigger> | ||
</DropdownMenu> | ||
</SidebarMenuItem> | ||
</SidebarMenu> | ||
</SidebarHeader> | ||
<SidebarContent> | ||
<SidebarGroup> | ||
<SidebarGroupLabel> | ||
<Button className="w-full mt-1.5 mb-1.5 h-[32px]"> | ||
{" "} | ||
<Plus /> New Post | ||
</Button> | ||
</SidebarGroupLabel> | ||
<SidebarGroupContent className="mt-2"> | ||
<SidebarMenu> | ||
{items.map((item) => ( | ||
<SidebarMenuItem key={item.title}> | ||
<SidebarMenuButton asChild> | ||
<Link to={item.url}> | ||
<button className="flex justify-center items-center gap-4"> | ||
<item.icon size={18} strokeWidth={2}/> | ||
<span>{item.title}</span> | ||
</button> | ||
</Link> | ||
</SidebarMenuButton> | ||
</SidebarMenuItem> | ||
))} | ||
</SidebarMenu> | ||
</SidebarGroupContent> | ||
</SidebarGroup> | ||
</SidebarContent> | ||
</Sidebar> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters