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