From 425323e6c80b48084c5e86f11ade2484a480400d Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 12 Sep 2024 08:06:14 -0600 Subject: [PATCH] Always show snapshot but hide buttons for frigate+ if not applicable --- .../overlay/detail/ObjectLifecycle.tsx | 18 ++++++++++----- .../overlay/detail/SearchDetailDialog.tsx | 23 +++++++++++-------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/web/src/components/overlay/detail/ObjectLifecycle.tsx b/web/src/components/overlay/detail/ObjectLifecycle.tsx index 5110ca020..ca8851b92 100644 --- a/web/src/components/overlay/detail/ObjectLifecycle.tsx +++ b/web/src/components/overlay/detail/ObjectLifecycle.tsx @@ -49,14 +49,14 @@ import { TooltipPortal } from "@radix-ui/react-tooltip"; type ObjectLifecycleProps = { className?: string; event: Event; - showBack?: boolean; + fullscreen?: boolean; setPane: React.Dispatch>; }; export default function ObjectLifecycle({ className, event, - showBack = true, + fullscreen = false, setPane, }: ObjectLifecycleProps) { const { data: eventSequence } = useSWR([ @@ -227,7 +227,7 @@ export default function ObjectLifecycle({ return (
- {showBack && ( + {!fullscreen && (
-
+
( handleThumbnailClick(index)} >
diff --git a/web/src/components/overlay/detail/SearchDetailDialog.tsx b/web/src/components/overlay/detail/SearchDetailDialog.tsx index 799010ccb..e2c9e93fa 100644 --- a/web/src/components/overlay/detail/SearchDetailDialog.tsx +++ b/web/src/components/overlay/detail/SearchDetailDialog.tsx @@ -34,14 +34,14 @@ import { baseUrl } from "@/api/baseUrl"; import { cn } from "@/lib/utils"; import ActivityIndicator from "@/components/indicators/activity-indicator"; import { ASPECT_VERTICAL_LAYOUT, ASPECT_WIDE_LAYOUT } from "@/types/record"; -import { FaRegListAlt, FaVideo } from "react-icons/fa"; +import { FaImage, FaRegListAlt, FaVideo } from "react-icons/fa"; import FrigatePlusIcon from "@/components/icons/FrigatePlusIcon"; import { FaRotate } from "react-icons/fa6"; import ObjectLifecycle from "./ObjectLifecycle"; const SEARCH_TABS = [ "details", - "frigate+", + "snapshot", "video", "object lifecycle", ] as const; @@ -73,8 +73,8 @@ export default function SearchDetailDialog({ const views = [...SEARCH_TABS]; - if (!config.plus.enabled || !search.has_snapshot) { - const index = views.indexOf("frigate+"); + if (!search.has_snapshot) { + const index = views.indexOf("snapshot"); views.splice(index, 1); } @@ -111,7 +111,7 @@ export default function SearchDetailDialog({ @@ -143,7 +143,7 @@ export default function SearchDetailDialog({ aria-label={`Select ${item}`} > {item == "details" && } - {item == "frigate+" && } + {item == "snapshot" && } {item == "video" && } {item == "object lifecycle" && ( @@ -163,9 +163,14 @@ export default function SearchDetailDialog({ setSimilarity={setSimilarity} /> )} - {page == "frigate+" && ( + {page == "snapshot" && ( {}} onEventUploaded={() => { @@ -178,7 +183,7 @@ export default function SearchDetailDialog({ {}} /> )}