Camera group layout fixes (#11334)

* camera group layout changes and tweaks

* lock aspect ratio

* no compacting

* prevent collisions

* revert

* readd limit aspect
This commit is contained in:
Josh Hawkins
2024-05-10 11:54:37 -05:00
committed by GitHub
parent 386ffbf5a6
commit 82e443a5c3
4 changed files with 216 additions and 55 deletions

View File

@@ -22,7 +22,8 @@ import {
import useSWR from "swr";
import DraggableGridLayout from "./DraggableGridLayout";
import { IoClose } from "react-icons/io5";
import { LuMove } from "react-icons/lu";
import { LuLayoutDashboard } from "react-icons/lu";
import { cn } from "@/lib/utils";
type LiveDashboardViewProps = {
cameras: CameraConfig[];
@@ -190,13 +191,18 @@ export default function LiveDashboardView({
{cameraGroup && cameraGroup !== "default" && isTablet && (
<div className="flex items-center gap-1">
<Button
className="p-1"
className={cn(
"p-1",
isEditMode
? "text-primary bg-selected"
: "text-secondary-foreground bg-secondary",
)}
size="xs"
onClick={() =>
setIsEditMode((prevIsEditMode) => !prevIsEditMode)
}
>
{isEditMode ? <IoClose /> : <LuMove />}
{isEditMode ? <IoClose /> : <LuLayoutDashboard />}
</Button>
</div>
)}