From 1b4e6789080b736e4bdf491b6108e390de9735c8 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 16 Dec 2024 16:19:10 +0100 Subject: [PATCH] fix: Types --- app/components/react-grid.tsx | 7 ++++++- app/configurator/configurator-state/reducer.tsx | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/components/react-grid.tsx b/app/components/react-grid.tsx index e328ba675..90cc8a62e 100644 --- a/app/components/react-grid.tsx +++ b/app/components/react-grid.tsx @@ -41,7 +41,7 @@ export const availableHandles: ResizeHandle[] = [ const MAX_H = 10; const INITIAL_H = 7; -const MIN_H = 1; +export const MIN_H = 1; /** In grid unit */ const MAX_W = 4; @@ -381,6 +381,7 @@ export const generateLayout = function ({ y: i * h, w: maxWidth, h, + minH: MIN_H, i: i.toString(), resizeHandles, }; @@ -392,6 +393,7 @@ export const generateLayout = function ({ y: 0, w: w, h: maxHeight, + minH: MIN_H, i: i.toString(), resizeHandles, }; @@ -403,6 +405,7 @@ export const generateLayout = function ({ y: i === 0 ? 0 : h * (i - 1), w: maxWidth / 2, h: i === 0 ? maxHeight : h, + minH: MIN_H, i: i.toString(), resizeHandles, }; @@ -413,6 +416,7 @@ export const generateLayout = function ({ y: Math.floor(i / 2) * INITIAL_H, w: getInitialTileWidth(), h: getInitialTileHeight(), + minH: MIN_H, i: i.toString(), resizeHandles: [], }; @@ -424,6 +428,7 @@ export const generateLayout = function ({ y: i === 0 ? 0 : maxHeight / 2, w: i === 0 ? maxWidth : w, h: maxHeight / 2, + minH: MIN_H, i: i.toString(), resizeHandles, }; diff --git a/app/configurator/configurator-state/reducer.tsx b/app/configurator/configurator-state/reducer.tsx index a3d43629c..0cab2e60a 100644 --- a/app/configurator/configurator-state/reducer.tsx +++ b/app/configurator/configurator-state/reducer.tsx @@ -24,6 +24,7 @@ import { FREE_CANVAS_BREAKPOINTS, getInitialTileHeight, getInitialTileWidth, + MIN_H, } from "@/components/react-grid"; import { ChartConfig, @@ -1206,6 +1207,7 @@ export function ensureDashboardLayoutIsCorrect( y: chartY, w: chartW, h: chartH, + minH: MIN_H, // Is initialized later resizeHandles: [], });