aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/screens/suggestedPeople/AnimatedTutorial.tsx40
1 files changed, 24 insertions, 16 deletions
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 (
<SafeAreaView>
- <GestureRecognizer onSwipeUp={handleCloseAnimationTutorial}>
- <View style={styles.container}>
- <View style={styles.textContainer}>
- <Text style={styles.text}>
- {'Swipe up to discover more people!'}
- </Text>
+ <TapGestureHandler onEnded={handleCloseAnimationTutorial}>
+ <PanGestureHandler
+ onActivated={handleCloseAnimationTutorial}
+ {...{activeOffsetY}}>
+ <View>
+ <View style={styles.textContainer}>
+ <Text style={styles.text}>
+ {'Swipe up to discover more people!'}
+ </Text>
+ </View>
+ <Image
+ source={require('../../assets/gifs/swipe-animation.gif')}
+ style={styles.swipeGif}
+ />
</View>
- <Image
- source={require('../../assets/gifs/swipe-animation.gif')}
- style={styles.swipeGif}
- />
- </View>
- </GestureRecognizer>
+ </PanGestureHandler>
+ </TapGestureHandler>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
- container: {
- flexDirection: 'column',
- },
closeButton: {
top: '2.55%',
left: '5%',