💄 Adjust GridStack sizes

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
Manuel Ruwe
2023-01-02 15:45:51 +01:00
parent 2a892d267f
commit 3ba90c87c6
3 changed files with 18 additions and 18 deletions

View File

@@ -19,7 +19,7 @@ export const initializeGridstack = (
) => {
if (!wrapperRef.current) return;
// calculates the currently available count of columns
const columnCount = areaType === 'sidebar' ? 4 : Math.floor(wrapperRef.current.offsetWidth / 64);
const columnCount = areaType === 'sidebar' ? 4 : 12;
const minRow = areaType !== 'sidebar' ? 1 : Math.floor(wrapperRef.current.offsetHeight / 64);
// initialize gridstack
const newGrid = gridRef;

View File

@@ -78,7 +78,7 @@ export const useGridstack = (
// change column count depending on the width and the gridRef
useEffect(() => {
if (areaType === 'sidebar') return;
gridRef.current?.column(Math.floor(width / 64), 'moveScale');
gridRef.current?.column(12);
}, [gridRef, width]);
const onChange = isEditMode