mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
🐛 Styling variables are changed to frequently sometimes
This commit is contained in:
@@ -81,12 +81,15 @@ export const useGridstack = (
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const widgetWidth = mainAreaWidth / wrapperColumnCount;
|
const widgetWidth = mainAreaWidth / wrapperColumnCount;
|
||||||
// widget width is used to define sizes of gridstack items within global.scss
|
// widget width is used to define sizes of gridstack items within global.scss
|
||||||
// TODO: improve
|
|
||||||
root.style.setProperty('--gridstack-widget-width', widgetWidth.toString());
|
root.style.setProperty('--gridstack-widget-width', widgetWidth.toString());
|
||||||
root.style.setProperty('--gridstack-column-count', wrapperColumnCount.toString());
|
|
||||||
gridRef.current?.cellHeight(widgetWidth);
|
gridRef.current?.cellHeight(widgetWidth);
|
||||||
}, [mainAreaWidth, wrapperColumnCount]);
|
}, [mainAreaWidth, wrapperColumnCount]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// column count is used to define count of columns of gridstack within global.scss
|
||||||
|
root.style.setProperty('--gridstack-column-count', wrapperColumnCount.toString());
|
||||||
|
}, [wrapperColumnCount]);
|
||||||
|
|
||||||
const onChange = isEditMode
|
const onChange = isEditMode
|
||||||
? (changedNode: GridStackNode) => {
|
? (changedNode: GridStackNode) => {
|
||||||
if (!configName) return;
|
if (!configName) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user