From d7ddcea951d69267774fd7788f08ac53e4d943f9 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sun, 8 Oct 2023 13:49:41 -0600 Subject: [PATCH] Show settings cog for camera toggles on mobile (#8098) * Show settings cog on mobile * Cleanup ui and remove label * Fix tests --- web/src/components/Switch.jsx | 4 +- web/src/routes/Cameras.jsx | 105 +++++++++++++++++--- web/src/routes/__tests__/Cameras.test.jsx | 2 + web/src/routes/__tests__/Recording.test.jsx | 2 + 4 files changed, 96 insertions(+), 17 deletions(-) diff --git a/web/src/components/Switch.jsx b/web/src/components/Switch.jsx index eaf42690d..db040f4a5 100644 --- a/web/src/components/Switch.jsx +++ b/web/src/components/Switch.jsx @@ -1,7 +1,7 @@ import { h } from 'preact'; import { useCallback, useState } from 'preact/hooks'; -export default function Switch({ checked, id, onChange, label, labelPosition = 'before' }) { +export default function Switch({ className, checked, id, onChange, label, labelPosition = 'before' }) { const [isFocused, setFocused] = useState(false); const handleChange = useCallback(() => { @@ -21,7 +21,7 @@ export default function Switch({ checked, id, onChange, label, labelPosition = ' return (