From f54cb21bd061d8677ed4b7906af244ebc1db9945 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:34:45 -0600 Subject: [PATCH] UI changes (#9823) * fix button within button * add subtle overlay gradient * try disconnecting to improve memory usage * rounded corners on gradients --- web/src/components/Header.tsx | 4 +-- web/src/components/player/LivePlayer.tsx | 19 +++++++++----- web/src/components/player/MsePlayer.tsx | 4 +++ .../components/settings/SettingsNavItems.tsx | 26 ++++++++++--------- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index 9eb84fe2f..0d67be7ed 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -50,9 +50,7 @@ function Header({ onToggleNavbar }: HeaderProps) {
-
- -
+
diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index 1c41f9ca5..09ed3c027 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -40,7 +40,10 @@ export default function LivePlayer({ const { activeMotion, activeAudio, activeTracking } = useCameraActivity(cameraConfig); - const cameraActive = useMemo(() => activeMotion || activeTracking, [activeMotion, activeTracking]) + const cameraActive = useMemo( + () => activeMotion || activeTracking, + [activeMotion, activeTracking] + ); const liveMode = useCameraLiveMode(cameraConfig, preferredLiveMode); const [liveReady, setLiveReady] = useState(false); @@ -168,8 +171,10 @@ export default function LivePlayer({ : "outline-0" } transition-all duration-500 ${className}`} > - {(showStillWithoutActivity == false || cameraActive) && - player} +
+
+ + {(showStillWithoutActivity == false || cameraActive) && player}
Motion
@@ -196,7 +201,7 @@ export default function LivePlayer({ {cameraConfig.audio.enabled_in_config && (
Sound
@@ -204,7 +209,7 @@ export default function LivePlayer({ )}
- + {recording == "ON" && ( )} diff --git a/web/src/components/player/MsePlayer.tsx b/web/src/components/player/MsePlayer.tsx index 14ac3363a..ebdf09b6f 100644 --- a/web/src/components/player/MsePlayer.tsx +++ b/web/src/components/player/MsePlayer.tsx @@ -243,6 +243,10 @@ function MSEPlayer({ camera, className, onPlaying }: MSEPlayerProps) { useEffect(() => { onConnect(); + + return () => { + onDisconnect(); + }; }, [wsURL]); return ( diff --git a/web/src/components/settings/SettingsNavItems.tsx b/web/src/components/settings/SettingsNavItems.tsx index 317424355..db42775d3 100644 --- a/web/src/components/settings/SettingsNavItems.tsx +++ b/web/src/components/settings/SettingsNavItems.tsx @@ -98,17 +98,19 @@ export default function SettingsNavItems({ className }: SettingsNavItemsProps) { <>
- - - - - - -

Settings

-
-
+ + + + + + + +

Settings

+
+
+
System @@ -242,7 +244,7 @@ export default function SettingsNavItems({ className }: SettingsNavItemsProps) {
- +