From 386ffbf5a6b02c6b900be84fb87b3090fcd4cb57 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 9 May 2024 16:08:22 -0500 Subject: [PATCH] Tweak camera group layout editor buttons (#11317) * tweak layout editor buttons * remove bubble * spacing * button backgrounds --- .../components/filter/CameraGroupSelector.tsx | 63 ++++++- web/src/views/live/DraggableGridLayout.tsx | 177 +++++++++++++----- web/themes/theme-default.css | 8 +- 3 files changed, 191 insertions(+), 57 deletions(-) diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index 38a246c00..fe0ff2fbc 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -360,6 +360,65 @@ function NewGroupDialog({ ); } +type EditGroupDialogProps = { + open: boolean; + setOpen: (open: boolean) => void; + currentGroups: [string, CameraGroupConfig][]; + activeGroup?: string; +}; +export function EditGroupDialog({ + open, + setOpen, + currentGroups, + activeGroup, +}: EditGroupDialogProps) { + // editing group and state + + const editingGroup = useMemo(() => { + if (currentGroups && activeGroup) { + return currentGroups.find(([groupName]) => groupName === activeGroup); + } else { + return undefined; + } + }, [currentGroups, activeGroup]); + + const [isLoading, setIsLoading] = useState(false); + + return ( + <> + + { + setOpen(open); + }} + > + +
+
+ Edit Camera Group +
+ setOpen(false)} + onCancel={() => setOpen(false)} + /> +
+
+
+ + ); +} + type CameraGroupRowProps = { group: [string, CameraGroupConfig]; onDeleteGroup: () => void; @@ -572,7 +631,7 @@ export function CameraGroupEdit({
- + + + {isEditMode ? "Exit Editing" : "Edit Layout"} + + + {!isEditMode && ( + <> + + + + + + {isEditMode ? "Exit Editing" : "Edit Camera Group"} + + + + + + + + {fullscreen ? "Exit Fullscreen" : "Fullscreen"} + + + + )} +
)} )} @@ -365,47 +481,6 @@ export default function DraggableGridLayout({ ); } -type DesktopEditLayoutButtonProps = { - isEditMode?: boolean; - setIsEditMode: React.Dispatch>; - hasScrollbar?: boolean | 0 | null; -}; - -function DesktopEditLayoutButton({ - isEditMode, - setIsEditMode, - hasScrollbar, -}: DesktopEditLayoutButtonProps) { - return ( -
- - - - - - {isEditMode ? "Exit Editing" : "Edit Layout"} - - -
- ); -} - function CornerCircles() { return ( <> diff --git a/web/themes/theme-default.css b/web/themes/theme-default.css index 804b2f9f2..fe19f301b 100644 --- a/web/themes/theme-default.css +++ b/web/themes/theme-default.css @@ -143,11 +143,11 @@ --muted-foreground: hsl(0, 0%, 32%); --muted-foreground: 0 0% 32%; - --accent: hsl(0, 0%, 15%); - --accent: 0 0% 15%; + --accent: hsl(0, 0%, 19%); + --accent: 0 0% 19%; - --accent-foreground: hsl(210, 40%, 98%); - --accent-foreground: 210 40% 98%; + --accent-foreground: hsl(210, 40%, 95%); + --accent-foreground: 210 40% 95%; --destructive: hsl(0, 62.8%, 30.6%); --destructive: 0 62.8% 30.6%;