From 9660535767852c6e0347b867beb246a44b0102bc Mon Sep 17 00:00:00 2001 From: Ivan Voskoboinyk Date: Wed, 5 Jan 2022 18:21:43 +0200 Subject: [PATCH] Fix prettier --- src/components/Lightbox/Lightbox.tsx | 38 +++++++++++++++------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/components/Lightbox/Lightbox.tsx b/src/components/Lightbox/Lightbox.tsx index e7510cfd..d10d0329 100644 --- a/src/components/Lightbox/Lightbox.tsx +++ b/src/components/Lightbox/Lightbox.tsx @@ -33,23 +33,27 @@ export const Lightbox: FunctionComponent = ({ onNext = noop, onPrevious = noop, }) => { - useEventListener(typeof window !== 'undefined' ? window : globalThis, 'keydown', (event: KeyboardEvent) => { - if (image === null) { - return; - } - - if (event.key === 'Esc') { - onClose(); - } - - if (event.key === 'ArrowLeft') { - onPrevious(); - } - - if (event.key === 'ArrowRight') { - onNext(); - } - }); + useEventListener( + typeof window !== 'undefined' ? window : globalThis, + 'keydown', + (event: KeyboardEvent) => { + if (image === null) { + return; + } + + if (event.key === 'Esc') { + onClose(); + } + + if (event.key === 'ArrowLeft') { + onPrevious(); + } + + if (event.key === 'ArrowRight') { + onNext(); + } + }, + ); if (typeof window === 'undefined') { // Do not render Lightbox outside of browser environment (i.e. SSR)