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