Skip to content

Commit

Permalink
Merge pull request #16 from Freelancer-god/feat/upload-image
Browse files Browse the repository at this point in the history
Fix: css
  • Loading branch information
onggiabayluon authored Jun 15, 2024
2 parents bbd3261 + 3d1e806 commit 6aa1562
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 31 deletions.
13 changes: 3 additions & 10 deletions src/components/subnav-dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
"use client";
import NavItem from "@/components/nav-item";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion";
import { MenuItem } from "@/types/menu-item";

export default function SubnavDropdown({ item }: { item: MenuItem }) {
Expand All @@ -14,13 +9,11 @@ export default function SubnavDropdown({ item }: { item: MenuItem }) {
return hasSubNav ? (
<Accordion type="single" collapsible className="w-full !border-b-0">
<AccordionItem value="item-1">
<AccordionTrigger className="py-2">
<AccordionTrigger className="">
<NavItem item={item} />
</AccordionTrigger>
<AccordionContent className="ml-2">
{item.subItems?.map((subitem: MenuItem) => (
<SubnavDropdown key={subitem.href} item={subitem} />
))}
{item.subItems?.map((subitem: MenuItem) => <SubnavDropdown key={subitem.href} item={subitem} />)}
</AccordionContent>
</AccordionItem>
</Accordion>
Expand Down
62 changes: 41 additions & 21 deletions src/lib/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import { MenuItem } from "@/types/menu-item";
import { GroupIcon, Home, HomeIcon, User, Users, Users2 } from "lucide-react";
import {
Building,
Building2,
GroupIcon,
Home,
HomeIcon,
Key,
KeySquare,
User,
Users,
Users2,
Users2Icon,
Wrench,
} from "lucide-react";

export const SIDEBAR_ITEMS: MenuItem[] = [
{
Expand All @@ -9,35 +22,42 @@ export const SIDEBAR_ITEMS: MenuItem[] = [
},
{
href: "#",
label: "users",
icon: <User className="h-4 w-4" />,
label: "Quản Lý đăng nhập",
icon: <KeySquare className="h-4 w-4" />,
subItems: [
{
href: "/dashboard/users",
label: "user list",
href: "/dashboard/employees",
label: "Employee",
icon: <User className="h-4 w-4" />,
},
{
href: "/dashboard/agents",
label: "agents",
icon: <GroupIcon className="h-4 w-4" />,
href: "/dashboard/roles",
label: "Roles",
icon: <Wrench className="h-4 w-4" />,
},
],
},
{
href: "/dashboard/employees",
label: "Employee",
icon: <User className="h-4 w-4" />,
},
{
href: "/dashboard/roles",
label: "Roles",
icon: <User className="h-4 w-4" />,
},
{
href: "/dashboard/chihois",
label: "Chi Hội",
icon: <Users2 className="h-4 w-4" />,
href: "#",
label: "Quản Lý chi hội",
icon: <Building2 className="h-4 w-4" />,
subItems: [
{
href: "/dashboard/chihois",
label: "Chi Hội",
icon: <Building className="h-4 w-4" />,
},
{
href: "/dashboard/tochucs",
label: "Tổ chức",
icon: <GroupIcon className="h-4 w-4" />,
},
{
href: "/dashboard/hoiviens",
label: "Hội viên",
icon: <User className="h-4 w-4" />,
},
],
},
];

Expand Down

0 comments on commit 6aa1562

Please sign in to comment.