From 0d106274d2e92a3d8c08e2f2775631ab8e6bbafa Mon Sep 17 00:00:00 2001
From: PJ-Watson <59647390+PJ-Watson@users.noreply.github.com>
Date: Fri, 12 Aug 2022 07:00:05 +0100
Subject: [PATCH] Manual merge of changes from react-swipeable branch, update
 react-swipeable version

---
 ui/package-lock.json                              | 15 +++++++++++++++
 ui/package.json                                   |  2 +-
 .../presentView/PresentNavigationOverlay.tsx      | 15 ++++++---------
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/ui/package-lock.json b/ui/package-lock.json
index e6aaa65..e1fa0d1 100644
--- a/ui/package-lock.json
+++ b/ui/package-lock.json
@@ -39,6 +39,7 @@
         "react-i18next": "^11.18.0",
         "react-router-dom": "^6.3.0",
         "react-scripts": "^5.0.1",
+        "react-swipeable": "^7.0.0",
         "react-test-renderer": "^18.2.0",
         "styled-components": "^5.3.5",
         "subscriptions-transport-ws": "^0.11.0",
@@ -20874,6 +20875,14 @@
         "react": "^16.3.0 || ^17.0.0 || ^18.0.0"
       }
     },
+    "node_modules/react-swipeable": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/react-swipeable/-/react-swipeable-7.0.0.tgz",
+      "integrity": "sha512-NI7KGfQ6gwNFN0Hor3vytYW3iRfMMaivGEuxcADOOfBCx/kqwXE8IfHFxEcxSUkxCYf38COLKYd9EMYZghqaUA==",
+      "peerDependencies": {
+        "react": "^16.8.3 || ^17 || ^18"
+      }
+    },
     "node_modules/react-test-renderer": {
       "version": "18.2.0",
       "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-18.2.0.tgz",
@@ -40414,6 +40423,12 @@
       "integrity": "sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==",
       "requires": {}
     },
+    "react-swipeable": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/react-swipeable/-/react-swipeable-7.0.0.tgz",
+      "integrity": "sha512-NI7KGfQ6gwNFN0Hor3vytYW3iRfMMaivGEuxcADOOfBCx/kqwXE8IfHFxEcxSUkxCYf38COLKYd9EMYZghqaUA==",
+      "requires": {}
+    },
     "react-test-renderer": {
       "version": "18.2.0",
       "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-18.2.0.tgz",
diff --git a/ui/package.json b/ui/package.json
index 3d2dfb6..0134147 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -49,7 +49,7 @@
     "react-i18next": "^11.18.0",
     "react-router-dom": "^6.3.0",
     "react-scripts": "^5.0.1",
-    "react-swipeable": "^6.1.0",
+    "react-swipeable": "^7.0.0",
     "react-test-renderer": "^18.2.0",
     "styled-components": "^5.3.5",
     "subscriptions-transport-ws": "^0.11.0",
diff --git a/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx b/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx
index 2596269..3962cde 100644
--- a/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx
+++ b/ui/src/components/photoGallery/presentView/PresentNavigationOverlay.tsx
@@ -3,7 +3,7 @@ import styled from 'styled-components'
 import { debounce, DebouncedFn } from '../../../helpers/utils'
 import { closePresentModeAction, GalleryAction } from '../mediaGalleryReducer'
 
-import { useSwipeable } from 'react-swipeable';
+import { useSwipeable } from 'react-swipeable'
 
 import ExitIcon from './icons/Exit'
 import NextIcon from './icons/Next'
@@ -98,21 +98,19 @@ const PresentNavigationOverlay = ({
   const handlers = useSwipeable({
     onSwipedLeft: () => dispatchMedia({ type: 'nextImage' }),
     onSwipedRight: () => dispatchMedia({ type: 'previousImage' }),
-    preventDefaultTouchmoveEvent: false,
-    trackMouse: false
-  });
+    preventScrollOnSwipe: false,
+    trackMouse: false,
+  })
 
   return (
-  
     <StyledOverlayContainer
       data-testid="present-overlay"
       onMouseMove={() => {
         onMouseMove.current && onMouseMove.current()
       }}
     >
-	  <div {...handlers} >
+    <div {...handlers}>
       {children}
-	  
       <NavigationButton
         aria-label="Previous image"
         className={hide ? 'hide' : undefined}
@@ -142,9 +140,8 @@ const PresentNavigationOverlay = ({
       >
         <ExitIcon />
       </ExitButton>
-	  </div>
+    </div>
     </StyledOverlayContainer>
-	
   )
 }
 
