From ed9c67804a33e93db518a487cbf27624e4b6c779 Mon Sep 17 00:00:00 2001
From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
Date: Tue, 12 Nov 2024 06:37:25 -0600
Subject: [PATCH] UI fixes (#14933)
* Fix plus dialog
* Remove activity indicator on review item download button
* fix explore view
---
.../components/button/DownloadVideoButton.tsx | 16 +-
.../components/card/SearchThumbnailFooter.tsx | 3 +
.../components/menu/SearchResultActions.tsx | 22 +--
.../overlay/detail/ReviewDetailDialog.tsx | 2 +-
.../overlay/detail/SearchDetailDialog.tsx | 2 +-
.../overlay/dialog/FrigatePlusDialog.tsx | 176 +++---------------
web/src/views/explore/ExploreView.tsx | 5 +
web/src/views/search/SearchView.tsx | 3 +
8 files changed, 44 insertions(+), 185 deletions(-)
diff --git a/web/src/components/button/DownloadVideoButton.tsx b/web/src/components/button/DownloadVideoButton.tsx
index 7545217bf..750b35607 100644
--- a/web/src/components/button/DownloadVideoButton.tsx
+++ b/web/src/components/button/DownloadVideoButton.tsx
@@ -1,7 +1,5 @@
-import { useState } from "react";
import { Button } from "@/components/ui/button";
import { toast } from "sonner";
-import ActivityIndicator from "../indicators/activity-indicator";
import { FaDownload } from "react-icons/fa";
import { formatUnixTimestampToDateTime } from "@/utils/dateUtil";
import { cn } from "@/lib/utils";
@@ -19,8 +17,6 @@ export function DownloadVideoButton({
startTime,
className,
}: DownloadVideoButtonProps) {
- const [isDownloading, setIsDownloading] = useState(false);
-
const formattedDate = formatUnixTimestampToDateTime(startTime, {
strftime_fmt: "%D-%T",
time_style: "medium",
@@ -29,7 +25,6 @@ export function DownloadVideoButton({
const filename = `${camera}_${formattedDate}.mp4`;
const handleDownloadStart = () => {
- setIsDownloading(true);
toast.success("Your review item video has started downloading.", {
position: "top-center",
});
@@ -39,19 +34,14 @@ export function DownloadVideoButton({
diff --git a/web/src/components/card/SearchThumbnailFooter.tsx b/web/src/components/card/SearchThumbnailFooter.tsx
index b959a82c5..33db0c598 100644
--- a/web/src/components/card/SearchThumbnailFooter.tsx
+++ b/web/src/components/card/SearchThumbnailFooter.tsx
@@ -13,6 +13,7 @@ type SearchThumbnailProps = {
findSimilar: () => void;
refreshResults: () => void;
showObjectLifecycle: () => void;
+ showSnapshot: () => void;
};
export default function SearchThumbnailFooter({
@@ -21,6 +22,7 @@ export default function SearchThumbnailFooter({
findSimilar,
refreshResults,
showObjectLifecycle,
+ showSnapshot,
}: SearchThumbnailProps) {
const { data: config } = useSWR("config");
@@ -54,6 +56,7 @@ export default function SearchThumbnailFooter({
findSimilar={findSimilar}
refreshResults={refreshResults}
showObjectLifecycle={showObjectLifecycle}
+ showSnapshot={showSnapshot}
/>
diff --git a/web/src/components/menu/SearchResultActions.tsx b/web/src/components/menu/SearchResultActions.tsx
index a07d27240..10f0ed623 100644
--- a/web/src/components/menu/SearchResultActions.tsx
+++ b/web/src/components/menu/SearchResultActions.tsx
@@ -37,15 +37,14 @@ import {
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
-import { FrigatePlusDialog } from "@/components/overlay/dialog/FrigatePlusDialog";
import useSWR from "swr";
-import { Event } from "@/types/event";
type SearchResultActionsProps = {
searchResult: SearchResult;
findSimilar: () => void;
refreshResults: () => void;
showObjectLifecycle: () => void;
+ showSnapshot: () => void;
isContextMenu?: boolean;
children?: ReactNode;
};
@@ -55,12 +54,12 @@ export default function SearchResultActions({
findSimilar,
refreshResults,
showObjectLifecycle,
+ showSnapshot,
isContextMenu = false,
children,
}: SearchResultActionsProps) {
const { data: config } = useSWR("config");
- const [showFrigatePlus, setShowFrigatePlus] = useState(false);
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const handleDelete = () => {
@@ -130,10 +129,7 @@ export default function SearchResultActions({
searchResult.has_snapshot &&
searchResult.end_time &&
!searchResult.plus_id && (
-