This commit is contained in:
Estifo77
2026-08-11 14:32:26 +03:00
parent 0fd78c7757
commit 0573e01769
2 changed files with 16 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ import {
Box,
rem,
Center,
useMantineColorScheme,
} from '@mantine/core';
import {
IconChevronRight,
@@ -54,6 +55,10 @@ function TreeNode({
const isSelected = selectedId === location.id;
const hasChildren =
Array.isArray(location.children) && location.children.length > 0;
const { colorScheme } = useMantineColorScheme();
const hoverBg = colorScheme === 'dark'
? 'var(--mantine-color-dark-6)'
: 'var(--mantine-color-gray-0)';
const toggle = useCallback(() => {
setOpened((prev) => !prev);
@@ -88,8 +93,7 @@ function TreeNode({
}}
onMouseEnter={(e) => {
if (!isSelected)
e.currentTarget.style.backgroundColor =
'var(--mantine-color-gray-0)';
e.currentTarget.style.backgroundColor = hoverBg;
}}
onMouseLeave={(e) => {
if (!isSelected)