From 872c58ddcf3b6185da9909131161f418d9960c07 Mon Sep 17 00:00:00 2001
From: George Rusu <george@tagg.id>
Date: Fri, 21 May 2021 10:14:39 -0700
Subject: Remove unnecessary comments, print statements

---
 src/components/common/Draggable.tsx | 57 ++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 29 deletions(-)

(limited to 'src/components/common/Draggable.tsx')

diff --git a/src/components/common/Draggable.tsx b/src/components/common/Draggable.tsx
index 94446a18..676e0fe5 100644
--- a/src/components/common/Draggable.tsx
+++ b/src/components/common/Draggable.tsx
@@ -5,20 +5,19 @@
 
 import React from 'react';
 import {
-  View,
-  Text,
-  Image,
-  PanResponder,
   Animated,
   Dimensions,
-  TouchableOpacity,
-  StyleSheet,
   GestureResponderEvent,
+  Image,
+  PanResponder,
   PanResponderGestureState,
   StyleProp,
+  StyleSheet,
+  Text,
+  TouchableOpacity,
+  View,
+  ViewStyle,
 } from 'react-native';
-// import PropTypes from 'prop-types';
-import {ViewStyle} from 'react-native';
 
 function clamp(number: number, min: number, max: number) {
   return Math.max(min, Math.min(number, max));
@@ -77,11 +76,11 @@ export default function Draggable(props: IProps) {
     animatedViewProps,
     touchableOpacityProps,
     onDrag,
-    // onShortPressRelease,
+    onShortPressRelease,
     onDragRelease,
-    // onLongPress,
-    // onPressIn,
-    // onPressOut,
+    onLongPress,
+    onPressIn,
+    onPressOut,
     onRelease,
     x,
     y,
@@ -195,10 +194,10 @@ export default function Draggable(props: IProps) {
         listener: handleOnDrag,
         useNativeDriver: false,
       }),
-      onPanResponderRelease: (_) => {
-        console.log('end');
-        // setZIndex(1);
-      },
+      // onPanResponderRelease: (_) => {
+      //   // console.log('end');
+      //   // setZIndex(1);
+      // },
     });
   }, [
     handleOnDrag,
@@ -281,15 +280,15 @@ export default function Draggable(props: IProps) {
     childSize.current = {x: width, y: height};
   }, []);
 
-  // const handlePressOut = React.useCallback(
-  //   (event: GestureResponderEvent) => {
-  //     onPressOut(event);
-  //     if (!isDragging.current) {
-  //       onRelease(event, false);
-  //     }
-  //   },
-  //   [onPressOut, onRelease],
-  // );
+  const handlePressOut = React.useCallback(
+    (event: GestureResponderEvent) => {
+      onPressOut(event);
+      if (!isDragging.current) {
+        onRelease(event, false);
+      }
+    },
+    [onPressOut, onRelease],
+  );
 
   const getDebugView = React.useCallback(() => {
     const {width, height} = Dimensions.get('window');
@@ -323,10 +322,10 @@ export default function Draggable(props: IProps) {
           onLayout={handleOnLayout}
           style={dragItemCss}
           disabled={true}
-          onPress={() => console.log('ere')}
-          onLongPress={() => console.log('eeee')}
-          onPressIn={() => console.log('HERE')}
-          onPressOut={() => console.log('reeee')}>
+          onPress={onShortPressRelease}
+          onLongPress={onLongPress}
+          onPressIn={onPressIn}
+          onPressOut={onPressOut}>
           {touchableContent}
         </TouchableOpacity>
       </Animated.View>
-- 
cgit v1.2.3-70-g09d2

