From d85f09cbed5f3d2501f791e689011ae127df1cbb Mon Sep 17 00:00:00 2001
From: Kristóf Marussy <kristof@marussy.com>
Date: Sun, 9 Jan 2022 20:33:53 +0100
Subject: build: Add prettier
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

eslint will also enforce prettier rules, so there is no need to call
prettier separately in CI.

Signed-off-by: Kristóf Marussy <kristof@marussy.com>
---
 .../src/components/BrowserViewPlaceholder.tsx      | 55 +++++++++++-----------
 1 file changed, 28 insertions(+), 27 deletions(-)

(limited to 'packages/renderer/src/components/BrowserViewPlaceholder.tsx')

diff --git a/packages/renderer/src/components/BrowserViewPlaceholder.tsx b/packages/renderer/src/components/BrowserViewPlaceholder.tsx
index 11c09d6..8f055e7 100644
--- a/packages/renderer/src/components/BrowserViewPlaceholder.tsx
+++ b/packages/renderer/src/components/BrowserViewPlaceholder.tsx
@@ -29,36 +29,37 @@ export default observer(() => {
   const store = useStore();
 
   // eslint-disable-next-line react-hooks/exhaustive-deps -- react-hooks doesn't support `throttle`.
-  const onResize = useCallback(throttle(([entry]: ResizeObserverEntry[]) => {
-    if (entry) {
-      const {
-        x,
-        y,
-        width,
-        height,
-      } = entry.target.getBoundingClientRect();
-      store.setBrowserViewBounds({
-        x,
-        y,
-        width,
-        height,
-      });
-    }
-  }, 100), [store]);
+  const onResize = useCallback(
+    throttle(([entry]: ResizeObserverEntry[]) => {
+      if (entry) {
+        const { x, y, width, height } = entry.target.getBoundingClientRect();
+        store.setBrowserViewBounds({
+          x,
+          y,
+          width,
+          height,
+        });
+      }
+    }, 100),
+    [store],
+  );
 
   const resizeObserverRef = useRef<ResizeObserver | null>(null);
 
-  const ref = useCallback((element: HTMLElement | null) => {
-    if (resizeObserverRef.current !== null) {
-      resizeObserverRef.current.disconnect();
-    }
-    if (element === null) {
-      resizeObserverRef.current = null;
-      return;
-    }
-    resizeObserverRef.current = new ResizeObserver(onResize);
-    resizeObserverRef.current.observe(element);
-  }, [onResize, resizeObserverRef]);
+  const ref = useCallback(
+    (element: HTMLElement | null) => {
+      if (resizeObserverRef.current !== null) {
+        resizeObserverRef.current.disconnect();
+      }
+      if (element === null) {
+        resizeObserverRef.current = null;
+        return;
+      }
+      resizeObserverRef.current = new ResizeObserver(onResize);
+      resizeObserverRef.current.observe(element);
+    },
+    [onResize, resizeObserverRef],
+  );
 
   return (
     <Box
-- 
cgit v1.2.3-54-g00ecf

