mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 13:02:50 +00:00
UI fixes
This commit is contained in:
@@ -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>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user