diff --git a/frontend/src/components/AMSHistoryModal.tsx b/frontend/src/components/AMSHistoryModal.tsx index 9260a41ea..a66d0537c 100644 --- a/frontend/src/components/AMSHistoryModal.tsx +++ b/frontend/src/components/AMSHistoryModal.tsx @@ -187,7 +187,7 @@ export function AMSHistoryModal({ {/* Content */}
{/* Time Range & Mode Selector */} -
+
{/* Stats Cards */} -
+
{mode === 'humidity' ? ( <> -
+

{t('common.current', 'Current')}

@@ -240,19 +240,19 @@ export function AMSHistoryModal({

-
+

{t('common.average', 'Average')}

{data?.avg_humidity != null ? `${data.avg_humidity}%` : '—'}

-
+

{t('common.min', 'Min')}

{data?.min_humidity != null ? `${data.min_humidity}%` : '—'}

-
+

{t('common.max', 'Max')}

{data?.max_humidity != null ? `${data.max_humidity}%` : '—'} @@ -261,7 +261,7 @@ export function AMSHistoryModal({ ) : ( <> -

+

{t('common.current', 'Current')}

@@ -270,19 +270,19 @@ export function AMSHistoryModal({

-
+

{t('common.average', 'Average')}

{data?.avg_temperature != null ? `${data.avg_temperature}°C` : '—'}

-
+

{t('common.min', 'Min')}

{data?.min_temperature != null ? `${data.min_temperature}°C` : '—'}

-
+

{t('common.max', 'Max')}

{data?.max_temperature != null ? `${data.max_temperature}°C` : '—'} diff --git a/frontend/src/components/Dashboard.tsx b/frontend/src/components/Dashboard.tsx index d6635327d..73b075530 100644 --- a/frontend/src/components/Dashboard.tsx +++ b/frontend/src/components/Dashboard.tsx @@ -178,7 +178,7 @@ export function Dashboard({ widgets, storageKey, columns = 4, stackBelow, hideCo if (!stackBelow) return undefined; const mediaQuery = window.matchMedia(`(max-width: ${stackBelow}px)`); const handleChange = (event: MediaQueryListEvent | MediaQueryList) => { - setIsStacked('matches' in event ? event.matches : event.matches); + setIsStacked(event.matches); }; handleChange(mediaQuery); const onChange = (event: MediaQueryListEvent) => handleChange(event); @@ -355,25 +355,23 @@ export function Dashboard({ widgets, storageKey, columns = 4, stackBelow, hideCo gridTemplateColumns: `repeat(${effectiveColumns}, minmax(0, 1fr))`, }} > - {visibleWidgets.map((widget) => ( - (() => { - const size = layout.sizes[widget.id] || 2; - const columnSpan = Math.min(size, effectiveColumns); - return ( - toggleVisibility(widget.id)} - onToggleSize={() => toggleSize(widget.id)} - /> - ); - })() - ))} + {visibleWidgets.map((widget) => { + const size = layout.sizes[widget.id] || 2; + const columnSpan = Math.min(size, effectiveColumns); + return ( + toggleVisibility(widget.id)} + onToggleSize={() => toggleSize(widget.id)} + /> + ); + })}

diff --git a/frontend/src/components/FilamentTrends.tsx b/frontend/src/components/FilamentTrends.tsx index 0858fa241..725625b10 100644 --- a/frontend/src/components/FilamentTrends.tsx +++ b/frontend/src/components/FilamentTrends.tsx @@ -157,7 +157,7 @@ export function FilamentTrends({ archives, currency = '$' }: FilamentTrendsProps return (
{/* Time Range Selector */} -
+

Filament Usage Trends

{(['7d', '30d', '90d', '365d', 'all'] as TimeRange[]).map((range) => ( @@ -177,7 +177,7 @@ export function FilamentTrends({ archives, currency = '$' }: FilamentTrendsProps
{/* Summary Cards */} -
+

Period Filament

diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index 4ede5f234..6264da0c3 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -8,7 +8,7 @@ import { SwitchbarPopover } from './SwitchbarPopover'; import { useQuery } from '@tanstack/react-query'; import { api, supportApi, pendingUploadsApi } from '../api/client'; import { getIconByName } from './IconPicker'; -import { useIsMobile } from '../hooks/useIsMobile'; +import { useIsSidebarCompact } from '../hooks/useIsSidebarCompact'; import { useAuth } from '../contexts/AuthContext'; import { useToast } from '../contexts/ToastContext'; import { Card, CardHeader, CardContent } from './Card'; @@ -72,7 +72,7 @@ export function Layout() { const location = useLocation(); const { mode, toggleMode } = useTheme(); const { t } = useTranslation(); - const isMobile = useIsMobile(); + const isSidebarCompact = useIsSidebarCompact(); const { user, authEnabled, logout, hasPermission } = useAuth(); const { showToast } = useToast(); const [showChangePasswordModal, setShowChangePasswordModal] = useState(false); @@ -311,12 +311,12 @@ export function Layout() { localStorage.setItem('sidebarExpanded', String(sidebarExpanded)); }, [sidebarExpanded]); - // Close mobile drawer on navigation + // Close compact drawer on navigation useEffect(() => { - if (isMobile) { + if (isSidebarCompact) { setMobileDrawerOpen(false); } - }, [location.pathname, isMobile]); + }, [location.pathname, isSidebarCompact]); // Listen for plate detection warnings (objects on plate, print paused) // Only show to users with printers:control permission @@ -390,8 +390,8 @@ export function Layout() { return (
- {/* Mobile Header */} - {isMobile && ( + {/* Compact Header */} + {isSidebarCompact && (
)} - {/* Mobile Drawer Backdrop */} - {isMobile && mobileDrawerOpen && ( + {/* Compact Drawer Backdrop */} + {isSidebarCompact && mobileDrawerOpen && (
setMobileDrawerOpen(false)} @@ -419,17 +419,17 @@ export function Layout() { {/* Sidebar / Mobile Drawer */}