From 764d80e1d91e0ab578a93005d92acc7c9d980751 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:21:26 -0500 Subject: [PATCH] fix frigate+ dialog when using mobile page component --- .../overlay/dialog/FrigatePlusDialog.tsx | 124 ++++++++++-------- 1 file changed, 71 insertions(+), 53 deletions(-) diff --git a/web/src/components/overlay/dialog/FrigatePlusDialog.tsx b/web/src/components/overlay/dialog/FrigatePlusDialog.tsx index 0c4801f8e..42f17109b 100644 --- a/web/src/components/overlay/dialog/FrigatePlusDialog.tsx +++ b/web/src/components/overlay/dialog/FrigatePlusDialog.tsx @@ -13,6 +13,7 @@ import { Event } from "@/types/event"; import { FrigateConfig } from "@/types/frigateConfig"; import axios from "axios"; import { useCallback, useMemo, useState } from "react"; +import { isDesktop } from "react-device-detect"; import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch"; import useSWR from "swr"; @@ -34,6 +35,9 @@ export function FrigatePlusDialog({ // layout + const Title = isDesktop ? DialogTitle : "div"; + const Description = isDesktop ? DialogDescription : "div"; + const grow = useMemo(() => { if (!config || !upload) { return ""; @@ -79,60 +83,74 @@ export function FrigatePlusDialog({ const content = ( - - Submit To Frigate+ - - Objects in locations you want to avoid are not false positives. - Submitting them as false positives will confuse the model. - - - - {upload?.id && ( - {`${upload?.label}`} - )} - +
+ + + Submit To Frigate+ + + + Objects in locations you want to avoid are not false positives. + Submitting them as false positives will confuse the model. + + + + {upload?.id && ( + {`${upload?.label}`} + )} + - - {state == "reviewing" && ( - <> - {dialog && } - - - - )} - {state == "uploading" && } - + + {state == "reviewing" && ( + <> + {dialog && } + + + + )} + {state == "uploading" && } + +
);