diff --git a/app/portal/page.tsx b/app/portal/page.tsx index 0481b12..8907e97 100644 --- a/app/portal/page.tsx +++ b/app/portal/page.tsx @@ -1,6 +1,5 @@ import { createClient } from "@/lib/supabase/server"; -import { Card, CardContent } from "poyraz-ui/atoms"; -import { Badge } from "poyraz-ui/molecules"; +import { Card, CardContent, Badge } from "poyraz-ui/atoms"; import { FolderKanban, CheckCircle2, Clock, ArrowRight } from "lucide-react"; import Link from "next/link"; import { format } from "date-fns"; diff --git a/components/layout/portal-shell.tsx b/components/layout/portal-shell.tsx index c520a00..1467cdb 100644 --- a/components/layout/portal-shell.tsx +++ b/components/layout/portal-shell.tsx @@ -10,10 +10,26 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "poyraz-ui/molecules"; -import { LogOut, User } from "lucide-react"; +import { + Sidebar, + SidebarBranding, + SidebarContent, + SidebarFooter, + SidebarHeader, + SidebarMenu, + SidebarMenuItem, + SidebarSection, + SidebarSeparator, + SidebarTrigger, + SidebarUserProfile, +} from "poyraz-ui/organisms"; +import { portalSidebarData } from "@/config/portal-sidebar"; +import { cn } from "@/lib/utils"; +import { ChevronUp, LogOut, Menu, Settings } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; +import { useState } from "react"; type PortalShellProps = { children: React.ReactNode; @@ -27,65 +43,194 @@ type PortalShellProps = { export function PortalShell({ children, user }: PortalShellProps) { const pathname = usePathname(); + const [isMobileSidebarOpen, setIsMobileSidebarOpen] = useState(false); return ( -
-
-
- - Cognis +
+ + + {isMobileSidebarOpen ? ( +
+
+ ) : null} + +
+
+ + Cognis + Cognis Portal - -
+ +
-
- - - - - - -
-

{user.displayName}

-

- {user.email} -

-
-
- - signOut()}> - - Çıkış Yap - -
-
+
{children}
- - -
- {children} -
+
); } + +function AppSidebar({ + pathname, + user, + onNavigate, +}: { + pathname: string; + user: PortalShellProps["user"]; + onNavigate?: () => void; +}) { + return ( + + + + } + /> + + + + + + {portalSidebarData.map((group, groupIndex) => ( +
+ + + {group.items.map((item) => { + const isActive = + item.href === "/portal" + ? pathname === "/portal" + : item.href + ? pathname === item.href || pathname.startsWith(item.href + "/") + : false; + const Icon = item.icon; + + return ( + : undefined} + className={cn(isActive && "font-semibold")} + > + + {item.title} + + + ); + })} + + + {groupIndex < portalSidebarData.length - 1 ? ( + + ) : null} +
+ ))} +
+ + + + + + + + + + +
+ + {user.displayName} + + + {user.email} + +
+
+ + + + + Ayarlar + + + +
+ + + +
+
+
+
+ + +
+ ); +} diff --git a/config/portal-sidebar.ts b/config/portal-sidebar.ts new file mode 100644 index 0000000..f39edab --- /dev/null +++ b/config/portal-sidebar.ts @@ -0,0 +1,25 @@ +import { + FolderKanban, + Sparkles, +} from "lucide-react"; + +export type PortalSidebarNavItem = { + title: string; + href?: string; + icon?: any; + items?: PortalSidebarNavItem[]; +}; + +export type PortalSidebarNavGroup = { + title: string; + items: PortalSidebarNavItem[]; +}; + +export const portalSidebarData: PortalSidebarNavGroup[] = [ + { + title: "GENEL BAKIŞ", + items: [ + { title: "Dashboard", href: "/portal", icon: Sparkles }, + ], + }, +];