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:
@@ -11,7 +11,7 @@ import {
|
|||||||
Box,
|
Box,
|
||||||
rem,
|
rem,
|
||||||
Center,
|
Center,
|
||||||
useMantineColorScheme,
|
useComputedColorScheme,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import {
|
import {
|
||||||
IconChevronRight,
|
IconChevronRight,
|
||||||
@@ -58,7 +58,7 @@ function TreeNode({
|
|||||||
const isSelected = selectedId === location.id;
|
const isSelected = selectedId === location.id;
|
||||||
const hasChildren =
|
const hasChildren =
|
||||||
Array.isArray(location.children) && location.children.length > 0;
|
Array.isArray(location.children) && location.children.length > 0;
|
||||||
const { colorScheme } = useMantineColorScheme();
|
const colorScheme = useComputedColorScheme('light', { getInitialValueInEffect: true });
|
||||||
const hoverBg = colorScheme === 'dark'
|
const hoverBg = colorScheme === 'dark'
|
||||||
? 'var(--mantine-color-dark-6)'
|
? 'var(--mantine-color-dark-6)'
|
||||||
: 'var(--mantine-color-gray-0)';
|
: 'var(--mantine-color-gray-0)';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
UnstyledButton,
|
UnstyledButton,
|
||||||
rem,
|
rem,
|
||||||
useMantineColorScheme,
|
useComputedColorScheme,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { useMediaQuery } from '@mantine/hooks';
|
import { useMediaQuery } from '@mantine/hooks';
|
||||||
import {
|
import {
|
||||||
@@ -285,7 +285,7 @@ export function AppSidebar({
|
|||||||
brandLogo,
|
brandLogo,
|
||||||
}: AppSidebarProps) {
|
}: AppSidebarProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { colorScheme } = useMantineColorScheme();
|
const colorScheme = useComputedColorScheme('light', { getInitialValueInEffect: true });
|
||||||
// The icon-rail toggle is a desktop-only affordance (its button is
|
// The icon-rail toggle is a desktop-only affordance (its button is
|
||||||
// `visibleFrom="sm"`) — on mobile the sidebar renders in a full-width
|
// `visibleFrom="sm"`) — on mobile the sidebar renders in a full-width
|
||||||
// drawer, so a `collapsed` state carried over from a prior desktop session
|
// drawer, so a `collapsed` state carried over from a prior desktop session
|
||||||
|
|||||||
Reference in New Issue
Block a user