From 1ac7ca2614d67fd98979cffd5fc576e5ef3dc22e Mon Sep 17 00:00:00 2001 From: Leon Jiang <35908040+leonyjiang@users.noreply.github.com> Date: Mon, 1 Mar 2021 20:03:53 -0500 Subject: Fix unresponsive swipe gesture handler --- src/screens/suggestedPeople/AnimatedTutorial.tsx | 40 ++++++++++++++---------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/screens/suggestedPeople/AnimatedTutorial.tsx b/src/screens/suggestedPeople/AnimatedTutorial.tsx index f7d62cee..6e0f78ae 100644 --- a/src/screens/suggestedPeople/AnimatedTutorial.tsx +++ b/src/screens/suggestedPeople/AnimatedTutorial.tsx @@ -2,8 +2,11 @@ import {useNavigation} from '@react-navigation/native'; import React from 'react'; import {StyleSheet, Text, View} from 'react-native'; import {Image} from 'react-native-animatable'; +import { + PanGestureHandler, + TapGestureHandler, +} from 'react-native-gesture-handler'; import {SafeAreaView} from 'react-native-safe-area-context'; -import GestureRecognizer from 'react-native-swipe-gestures'; import {useDispatch, useSelector} from 'react-redux'; import {suggestedPeopleAnimatedTutorialFinished} from '../../store/actions/user'; import {RootState} from '../../store/rootReducer'; @@ -18,29 +21,34 @@ const AnimatedTutorial: React.FC = () => { dispatch(suggestedPeopleAnimatedTutorialFinished(user.userId)); navigation.pop(); }; + + // don't dismiss the tutorial if swipe gesture isn't sufficiently large + const activeOffsetY: number = -15; + return ( - - - - - {'Swipe up to discover more people!'} - + + + + + + {'Swipe up to discover more people!'} + + + - - - + + ); }; const styles = StyleSheet.create({ - container: { - flexDirection: 'column', - }, closeButton: { top: '2.55%', left: '5%', -- cgit v1.2.3-70-g09d2