From f035e31dcfc4a74c106b1a29979b5cdef9ba1e32 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 26 Oct 2025 11:59:19 +0100 Subject: [PATCH] cosmetic improvements --- interface/src/CustomTheme.tsx | 25 +++++++- interface/src/app/main/CustomEntities.tsx | 2 +- interface/src/app/main/Dashboard.tsx | 66 ++++++++++++--------- interface/src/app/main/Devices.tsx | 10 +--- interface/src/app/main/Help.tsx | 4 +- interface/src/app/main/Scheduler.tsx | 2 +- interface/src/app/main/Sensors.tsx | 4 +- interface/src/app/settings/Settings.tsx | 21 ++++--- interface/src/app/status/Status.tsx | 2 +- interface/src/components/ButtonTooltip.tsx | 23 ++----- interface/src/components/SectionContent.tsx | 22 ++----- 11 files changed, 92 insertions(+), 89 deletions(-) diff --git a/interface/src/CustomTheme.tsx b/interface/src/CustomTheme.tsx index 850a95119..223e55ba7 100644 --- a/interface/src/CustomTheme.tsx +++ b/interface/src/CustomTheme.tsx @@ -1,7 +1,12 @@ import { memo } from 'react'; import type { FC } from 'react'; -import { CssBaseline, ThemeProvider, responsiveFontSizes } from '@mui/material'; +import { + CssBaseline, + ThemeProvider, + responsiveFontSizes, + tooltipClasses +} from '@mui/material'; import { createTheme } from '@mui/material/styles'; import type { RequiredChildrenProps } from 'utils'; @@ -44,6 +49,24 @@ const theme = responsiveFontSizes( color: '#9e9e9e' // grey[500] } } + }, + MuiTooltip: { + defaultProps: { + placement: 'top', + arrow: true + }, + styleOverrides: { + tooltip: { + padding: '4px 8px', + fontSize: 10, + color: 'rgba(0, 0, 0, 0.87)', + backgroundColor: '#4caf50', // MUI success.main default color + boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.15)', + [`& .${tooltipClasses.arrow}`]: { + color: '#4caf50' + } + } + } } } }) diff --git a/interface/src/app/main/CustomEntities.tsx b/interface/src/app/main/CustomEntities.tsx index 26e66041f..9c36ad394 100644 --- a/interface/src/app/main/CustomEntities.tsx +++ b/interface/src/app/main/CustomEntities.tsx @@ -327,7 +327,7 @@ const CustomEntities = () => { /> )} - + {numChanges > 0 && ( diff --git a/interface/src/app/main/Dashboard.tsx b/interface/src/app/main/Dashboard.tsx index fa318bbac..cf44a86c2 100644 --- a/interface/src/app/main/Dashboard.tsx +++ b/interface/src/app/main/Dashboard.tsx @@ -14,6 +14,7 @@ import { IconButton, ToggleButton, ToggleButtonGroup, + Tooltip, Typography } from '@mui/material'; @@ -284,37 +285,44 @@ const Dashboard = memo(() => { {data.nodes.length > 0 && ( <> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + { const renderCoreData = () => ( <> - + { divider={} sx={{ borderRadius: 3, - border: '2px solid grey', + border: '1px solid lightblue', justifyContent: 'space-evenly', alignItems: 'center' }} @@ -99,7 +99,7 @@ const Help = () => { )} {me.admin && ( - + { /> )} - + {numChanges !== 0 && ( diff --git a/interface/src/app/main/Sensors.tsx b/interface/src/app/main/Sensors.tsx index c8a37fd91..1f8c13a04 100644 --- a/interface/src/app/main/Sensors.tsx +++ b/interface/src/app/main/Sensors.tsx @@ -105,8 +105,6 @@ const Sensors = () => { color: #90CAF9; .th { border-bottom: 1px solid #565656; - } - .th { height: 36px; } `, @@ -491,7 +489,7 @@ const Sensors = () => { /> )} {sensorData?.analog_enabled === true && me.admin && ( - + - + ); - - return {content()}; }; export default Settings; diff --git a/interface/src/app/status/Status.tsx b/interface/src/app/status/Status.tsx index 286901424..bb1f0b76c 100644 --- a/interface/src/app/status/Status.tsx +++ b/interface/src/app/status/Status.tsx @@ -253,7 +253,7 @@ const SystemStatus = () => { return ( <> - + ( - -))(({ theme }) => ({ - [`& .${tooltipClasses.arrow}`]: { - color: theme.palette.success.main - }, - [`& .${tooltipClasses.tooltip}`]: { - backgroundColor: theme.palette.success.main, - color: 'rgba(0, 0, 0, 0.87)', - boxShadow: theme.shadows[1], - fontSize: 10 - } -})); +export const ButtonTooltip = ({ children, ...props }: TooltipProps) => ( + {children} +); export default ButtonTooltip; diff --git a/interface/src/components/SectionContent.tsx b/interface/src/components/SectionContent.tsx index 3dcc56c27..97615bbc4 100644 --- a/interface/src/components/SectionContent.tsx +++ b/interface/src/components/SectionContent.tsx @@ -1,30 +1,20 @@ import type { FC } from 'react'; -import { Divider, Paper } from '@mui/material'; +import { Paper } from '@mui/material'; import type { RequiredChildrenProps } from 'utils'; interface SectionContentProps extends RequiredChildrenProps { - title?: string; id?: string; } const SectionContent: FC = (props) => { - const { children, title, id } = props; + const { children, id } = props; return ( - - {title && ( - - {title} - - )} + {children} );