From fbc55b5e15824e2bdbd8b2e0bd26d8cdf4c49c35 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 3 Mar 2024 07:27:06 -0600 Subject: [PATCH] new indicator --- .../components/CameraActivityIndicator.tsx | 33 +++++++++++++++++ web/src/components/player/LivePlayer.tsx | 35 +++++-------------- web/src/pages/UIPlayground.tsx | 4 +++ web/tailwind.config.js | 26 ++++++++++++++ 4 files changed, 72 insertions(+), 26 deletions(-) create mode 100644 web/src/components/CameraActivityIndicator.tsx diff --git a/web/src/components/CameraActivityIndicator.tsx b/web/src/components/CameraActivityIndicator.tsx new file mode 100644 index 000000000..77a87477d --- /dev/null +++ b/web/src/components/CameraActivityIndicator.tsx @@ -0,0 +1,33 @@ +function CameraActivityIndicator() { + return ( +
+
+
+
+
+
+
+
+ + + + + + + + + +
+ ); +} + +export default CameraActivityIndicator; diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index 663e60808..6526f2a4f 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -5,14 +5,13 @@ import ActivityIndicator from "../ui/activity-indicator"; import { useEffect, useMemo, useState } from "react"; import MSEPlayer from "./MsePlayer"; import JSMpegPlayer from "./JSMpegPlayer"; -import { MdCircle, MdLeakAdd } from "react-icons/md"; -import { BsSoundwave } from "react-icons/bs"; -import Chip from "../Chip"; +import { MdCircle } from "react-icons/md"; import useCameraActivity from "@/hooks/use-camera-activity"; import { useRecordingsState } from "@/api/ws"; import { LivePlayerMode } from "@/types/live"; import useCameraLiveMode from "@/hooks/use-camera-live-mode"; import { isDesktop } from "react-device-detect"; +import CameraActivityIndicator from "../CameraActivityIndicator"; type LivePlayerProps = { className?: string; @@ -159,35 +158,19 @@ export default function LivePlayer({ /> -
- - -
Motion
-
- - {cameraConfig.audio.enabled_in_config && ( - - -
Sound
-
+
+ {(activeMotion || + (cameraConfig.audio.enabled_in_config && activeAudio)) && ( + )}
{isDesktop && ( - +
{recording == "ON" && ( - + )} -
- {cameraConfig.name.replaceAll("_", " ")} -
- +
)}
); diff --git a/web/src/pages/UIPlayground.tsx b/web/src/pages/UIPlayground.tsx index 003787b9c..1500b94c0 100644 --- a/web/src/pages/UIPlayground.tsx +++ b/web/src/pages/UIPlayground.tsx @@ -6,6 +6,7 @@ import ActivityIndicator from "@/components/ui/activity-indicator"; import EventReviewTimeline from "@/components/timeline/EventReviewTimeline"; import { ReviewData, ReviewSegment, ReviewSeverity } from "@/types/review"; import { Button } from "@/components/ui/button"; +import CameraActivityIndicator from "@/components/CameraActivityIndicator"; // Color data const colors = [ @@ -174,6 +175,9 @@ function UIPlayground() {

Handlebar is dragging: {isDragging ? "yes" : "no"}

+
+ +