This commit is contained in:
estifanos
2026-08-19 08:10:09 +00:00
parent 0e4db93396
commit 290f6dfd9c

View File

@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'react';
import { import {
AppShell, AppShell,
Badge, Badge,
Collapse,
Group, Group,
NavLink, NavLink,
Popover, Popover,
@@ -14,7 +15,6 @@ import {
useMantineColorScheme, useMantineColorScheme,
} from '@mantine/core'; } from '@mantine/core';
import { import {
IconChevronDown,
IconChevronLeft, IconChevronLeft,
IconChevronRight, IconChevronRight,
} from '@tabler/icons-react'; } from '@tabler/icons-react';
@@ -410,11 +410,15 @@ export function AppSidebar({
> >
{t(section.label)} {t(section.label)}
</Text> </Text>
{sectionOpened ? ( <IconChevronRight
<IconChevronDown size={14} stroke={1.8} color="var(--mantine-color-gray-5)" /> size={14}
) : ( stroke={1.8}
<IconChevronRight size={14} stroke={1.8} color="var(--mantine-color-gray-5)" /> color="var(--mantine-color-gray-5)"
)} style={{
transform: sectionOpened ? 'rotate(90deg)' : 'rotate(0deg)',
transition: 'transform 200ms ease',
}}
/>
</UnstyledButton> </UnstyledButton>
)} )}
{section.label && collapsed && sectionIndex > 0 && ( {section.label && collapsed && sectionIndex > 0 && (
@@ -426,18 +430,21 @@ export function AppSidebar({
}} }}
/> />
)} )}
{(!section.label || sectionOpened || collapsed) && <Collapse in={!section.label || sectionOpened || collapsed}>
section.items.map((item) => ( <Stack gap={2}>
<SidebarItem {section.items.map((item) => (
key={item.label} <SidebarItem
item={item} key={item.label}
collapsed={collapsed} item={item}
activePath={activePath} collapsed={collapsed}
onNavigate={onNavigate} activePath={activePath}
opened={openMap[item.label] ?? isBranchActive(item, activePath)} onNavigate={onNavigate}
onToggle={(next) => setItemOpened(item.label, next)} opened={openMap[item.label] ?? isBranchActive(item, activePath)}
/> onToggle={(next) => setItemOpened(item.label, next)}
))} />
))}
</Stack>
</Collapse>
</Stack> </Stack>
); );
})} })}