diff options
author | George Rusu <george@tagg.id> | 2021-05-21 10:14:39 -0700 |
---|---|---|
committer | George Rusu <george@tagg.id> | 2021-05-21 10:14:39 -0700 |
commit | 872c58ddcf3b6185da9909131161f418d9960c07 (patch) | |
tree | 0b566c6d9afe1ef8672817989a15b9500bc095f9 /src/components | |
parent | 1dd836609297a287d4ce32ef61c72746f8ac838c (diff) |
Remove unnecessary comments, print statements
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/common/Draggable.tsx | 57 | ||||
-rw-r--r-- | src/components/taggs/TaggDraggable.tsx | 12 |
2 files changed, 34 insertions, 35 deletions
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> diff --git a/src/components/taggs/TaggDraggable.tsx b/src/components/taggs/TaggDraggable.tsx index 1ef2e69f..4e45f000 100644 --- a/src/components/taggs/TaggDraggable.tsx +++ b/src/components/taggs/TaggDraggable.tsx @@ -37,12 +37,12 @@ const TaggDraggable: React.FC<TaggDraggableProps> = ( const draggableRef = useRef(null); useEffect(() => { draggableRef.current.measure((fx, fy, width, height, px, py) => { - console.log('Drag Component width is: ' + width); - console.log('Drag Component height is: ' + height); - console.log('X offset to frame: ' + fx); - console.log('Y offset to frame: ' + fy); - console.log('X offset to page: ' + px); - console.log('Y offset to page: ' + py); + // console.log('Drag Component width is: ' + width); + // console.log('Drag Component height is: ' + height); + // console.log('X offset to frame: ' + fx); + // console.log('Y offset to frame: ' + fy); + // console.log('X offset to page: ' + px); + // console.log('Y offset to page: ' + py); setStart([width, height]); }); }, []); |