From 12855b1002ebf200f0f6cd4831fb4c69aaa26519 Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Wed, 20 Aug 2025 16:46:55 +0100 Subject: [PATCH] Tooltip colours --- .../components/fileManager/DesktopLayout.tsx | 46 ++++++------ .../components/fileManager/FileActions.tsx | 75 +++++++++---------- .../components/fileManager/FileListItem.tsx | 2 +- frontend/src/theme/mantineTheme.ts | 13 ++++ 4 files changed, 72 insertions(+), 64 deletions(-) diff --git a/frontend/src/components/fileManager/DesktopLayout.tsx b/frontend/src/components/fileManager/DesktopLayout.tsx index d2b87de70..8d1e32ffc 100644 --- a/frontend/src/components/fileManager/DesktopLayout.tsx +++ b/frontend/src/components/fileManager/DesktopLayout.tsx @@ -18,27 +18,27 @@ const DesktopLayout: React.FC = () => { return ( {/* Column 1: File Sources */} - - + {/* Column 2: File List */} - -
{ }}> {activeSource === 'recent' && ( <> -
-
@@ -61,11 +61,11 @@ const DesktopLayout: React.FC = () => {
)} - +
0 ? modalHeight : '100%', backgroundColor: 'transparent', border: 'none', @@ -75,12 +75,12 @@ const DesktopLayout: React.FC = () => {
- + {/* Column 3: File Details */} - @@ -88,11 +88,11 @@ const DesktopLayout: React.FC = () => { - + {/* Hidden file input for local file selection */}
); }; -export default DesktopLayout; \ No newline at end of file +export default DesktopLayout; diff --git a/frontend/src/components/fileManager/FileActions.tsx b/frontend/src/components/fileManager/FileActions.tsx index ec065fa08..7bc8d27bc 100644 --- a/frontend/src/components/fileManager/FileActions.tsx +++ b/frontend/src/components/fileManager/FileActions.tsx @@ -1,21 +1,15 @@ -import React from 'react'; -import { Group, Button, Text, Tooltip, ActionIcon } from '@mantine/core'; -import SelectAllIcon from '@mui/icons-material/SelectAll'; -import DeleteIcon from '@mui/icons-material/Delete'; -import DownloadIcon from '@mui/icons-material/Download'; -import { useTranslation } from 'react-i18next'; -import { useFileManagerContext } from '../../contexts/FileManagerContext'; +import React from "react"; +import { Group, Text, ActionIcon, Tooltip } from "@mantine/core"; +import SelectAllIcon from "@mui/icons-material/SelectAll"; +import DeleteIcon from "@mui/icons-material/Delete"; +import DownloadIcon from "@mui/icons-material/Download"; +import { useTranslation } from "react-i18next"; +import { useFileManagerContext } from "../../contexts/FileManagerContext"; const FileActions: React.FC = () => { const { t } = useTranslation(); - const { - recentFiles, - selectedFileIds, - filteredFiles, - onSelectAll, - onDeleteSelected, - onDownloadSelected, - } = useFileManagerContext(); + const { recentFiles, selectedFileIds, filteredFiles, onSelectAll, onDeleteSelected, onDownloadSelected } = + useFileManagerContext(); const handleSelectAll = () => { onSelectAll(); @@ -42,52 +36,53 @@ const FileActions: React.FC = () => { const hasSelection = selectedFileIds.length > 0; return ( -
+
{/* Left: Select All */}
- +
{/* Center: Selected count */} -
+
{hasSelection && ( - {t('fileManager.selectedCount', '{{count}} selected', { count: selectedFileIds.length })} + {t("fileManager.selectedCount", "{{count}} selected", { count: selectedFileIds.length })} )}
{/* Right: Delete and Download */} - + { disabled={!hasSelection} radius="sm" > - + - + { disabled={!hasSelection} radius="sm" > - + diff --git a/frontend/src/components/fileManager/FileListItem.tsx b/frontend/src/components/fileManager/FileListItem.tsx index cb050d686..4b0e408d1 100644 --- a/frontend/src/components/fileManager/FileListItem.tsx +++ b/frontend/src/components/fileManager/FileListItem.tsx @@ -40,7 +40,7 @@ const FileListItem: React.FC = ({ p="sm" style={{ cursor: 'pointer', - backgroundColor: isSelected ? 'var(--mantine-color-gray-0)' : (shouldShowHovered ? 'var(--mantine-color-gray-0)' : 'var(--bg-file-list)'), + backgroundColor: isSelected ? 'var(--mantine-color-gray-1)' : (shouldShowHovered ? 'var(--mantine-color-gray-1)' : 'var(--bg-file-list)'), opacity: isSupported ? 1 : 0.5, transition: 'background-color 0.15s ease', userSelect: 'none', diff --git a/frontend/src/theme/mantineTheme.ts b/frontend/src/theme/mantineTheme.ts index 27e70d461..a8552b2bb 100644 --- a/frontend/src/theme/mantineTheme.ts +++ b/frontend/src/theme/mantineTheme.ts @@ -191,6 +191,19 @@ export const mantineTheme = createTheme({ }, }, }, + Tooltip: { + styles: { + tooltip: { + backgroundColor: 'var( --tooltip-title-bg)', + color: 'var( --tooltip-title-color)', + border: '1px solid var(--tooltip-borderp)', + fontSize: '0.75rem', + fontWeight: '500', + boxShadow: 'var(--shadow-md)', + borderRadius: 'var(--radius-sm)', + }, + }, + }, Checkbox: { styles: {