From f6d583611033c5013acde9fd7c330fda11171d8a Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:37:44 -0500 Subject: [PATCH] use drawer on mobile --- .../components/filter/CameraGroupSelector.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index 961151006..492162405 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -13,6 +13,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip"; import { getIconForGroup } from "@/utils/iconUtil"; import { LuPencil, LuPlus } from "react-icons/lu"; import { Dialog, DialogContent, DialogTitle } from "../ui/dialog"; +import { Drawer, DrawerContent } from "../ui/drawer"; import { Input } from "../ui/input"; import { Separator } from "../ui/separator"; import { @@ -267,18 +268,23 @@ function NewGroupDialog({ setEditState("edit"); }, []); + const Overlay = isDesktop ? Dialog : Drawer; + const Content = isDesktop ? DialogContent : DrawerContent; + return ( <> - { setEditState("none"); setOpen(open); }} > - - + + {editState === "none" && ( <> @@ -322,8 +328,8 @@ function NewGroupDialog({ > )} - - + + > ); }