mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 22:57:40 +03:00
Fix unused marginValue variable after removing grid spacing
Removed marginValue state and useLayoutEffect that calculated font size, and removed unused useLayoutEffect import. https://claude.ai/code/session_01THf2SuS7hLt9NgstxvKdg8
This commit is contained in:
parent
b7b5b08d53
commit
b22dc4c946
@ -8,7 +8,6 @@ import {
|
|||||||
import React, {
|
import React, {
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useLayoutEffect,
|
|
||||||
useMemo,
|
useMemo,
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
@ -314,19 +313,6 @@ export default function DraggableGridLayout({
|
|||||||
isGridLayoutLoaded,
|
isGridLayoutLoaded,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const [marginValue, setMarginValue] = useState(16);
|
|
||||||
|
|
||||||
// calculate margin value for browsers that don't have default font size of 16px
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
const calculateRemValue = () => {
|
|
||||||
const htmlElement = document.documentElement;
|
|
||||||
const fontSize = window.getComputedStyle(htmlElement).fontSize;
|
|
||||||
setMarginValue(parseFloat(fontSize));
|
|
||||||
};
|
|
||||||
|
|
||||||
calculateRemValue();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const [containerWidth, setContainerWidth] = useState(0);
|
const [containerWidth, setContainerWidth] = useState(0);
|
||||||
const [containerHeight, setContainerHeight] = useState(0);
|
const [containerHeight, setContainerHeight] = useState(0);
|
||||||
const roRef = useRef<ResizeObserver | null>(null);
|
const roRef = useRef<ResizeObserver | null>(null);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user