Fix linter and fix lint issues (#10141)

This commit is contained in:
Nicolas Mowen
2024-02-28 15:23:56 -07:00
committed by GitHub
parent b6ef1e4330
commit 3bf2a496e1
63 changed files with 527 additions and 418 deletions

View File

@@ -8,7 +8,7 @@ type CameraImageProps = {
className?: string;
camera: string;
onload?: (event: Event) => void;
searchParams?: {};
searchParams?: string;
stretch?: boolean; // stretch to fit width
fitAspect?: number; // shrink to fit height
};
@@ -58,10 +58,17 @@ export default function CameraImage({
}
return 100;
}, [availableWidth, aspectRatio, height, stretch]);
}, [
availableWidth,
aspectRatio,
containerHeight,
fitAspect,
height,
stretch,
]);
const scaledWidth = useMemo(
() => Math.ceil(scaledHeight * aspectRatio - scrollBarWidth),
[scaledHeight, aspectRatio, scrollBarWidth]
[scaledHeight, aspectRatio, scrollBarWidth],
);
const img = useMemo(() => new Image(), []);
@@ -74,7 +81,7 @@ export default function CameraImage({
}
onload && onload(event);
},
[img, scaledHeight, scaledWidth, setHasLoaded, onload, canvasRef]
[img, scaledHeight, scaledWidth, setHasLoaded, onload, canvasRef],
);
useEffect(() => {