mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 18:26:36 +08:00
feat(wavelet): 侧栏新增网站管理折叠组
使用 shadcn Collapsible 与 SidebarMenuSub 收纳网站、证书、DNS、源站入口。
This commit is contained in:
@@ -63,6 +63,7 @@ import {
|
||||
|
||||
import {useUser} from "@/contexts/user-context"
|
||||
import {usePublicConfig} from "@/hooks/use-public-config"
|
||||
import {OpenFlareSidebarMenu} from "@/components/layout/openflare-sidebar-menu"
|
||||
import {openflareNavItems} from "@/lib/navigation/openflare-nav"
|
||||
|
||||
/* 导航数据 */
|
||||
@@ -297,26 +298,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
||||
{openflareNavItems.length > 0 && (
|
||||
<SidebarGroup className="py-0">
|
||||
<SidebarGroupContent className="py-1">
|
||||
<SidebarMenu className="gap-1">
|
||||
{openflareNavItems.map((item) => (
|
||||
<SidebarMenuItem key={item.title}>
|
||||
<SidebarMenuButton
|
||||
tooltip={item.title}
|
||||
isActive={
|
||||
item.url === "/"
|
||||
? pathname === "/"
|
||||
: pathname === item.url || pathname.startsWith(`${item.url}/`)
|
||||
}
|
||||
asChild
|
||||
>
|
||||
<Link href={item.url} onClick={handleCloseSidebar}>
|
||||
<item.icon />
|
||||
<span>{item.title}</span>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
))}
|
||||
</SidebarMenu>
|
||||
<OpenFlareSidebarMenu onNavigate={handleCloseSidebar} />
|
||||
</SidebarGroupContent>
|
||||
</SidebarGroup>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user