mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
Simplify dev mode gesture (#635)
* Simplify developer mode gesture * Enable dev mode on MockData screen with five taps
This commit is contained in:
committed by
GitHub
parent
cfed790593
commit
08c1ead315
@@ -260,9 +260,8 @@ const MockDataScreen: React.FC<MockDataScreenProps> = ({}) => {
|
||||
selectedDocumentType,
|
||||
]);
|
||||
|
||||
const twoFingerTripleTap = Gesture.Tap()
|
||||
.minPointers(2)
|
||||
.numberOfTaps(3)
|
||||
const devModeTap = Gesture.Tap()
|
||||
.numberOfTaps(5)
|
||||
.onStart(() => {
|
||||
setAdvancedMode(true);
|
||||
buttonTap();
|
||||
@@ -274,7 +273,7 @@ const MockDataScreen: React.FC<MockDataScreenProps> = ({}) => {
|
||||
<YStack f={1} bg={white} pt={top} pb={bottom}>
|
||||
<ScrollView showsVerticalScrollIndicator={false}>
|
||||
<YStack px="$4" pb="$4" gap="$5">
|
||||
<GestureDetector gesture={twoFingerTripleTap}>
|
||||
<GestureDetector gesture={devModeTap}>
|
||||
<YStack ai="center" mb={'$10'}>
|
||||
<Title>Generate Document Data</Title>
|
||||
<BodyText textAlign="center">
|
||||
|
||||
@@ -26,8 +26,7 @@ const LaunchScreen: React.FC<LaunchScreenProps> = ({}) => {
|
||||
const skipToHome = useHapticNavigation('Home');
|
||||
const createMock = useHapticNavigation('CreateMock');
|
||||
const { height } = useWindowDimensions();
|
||||
const twoFingerTap = Gesture.Tap()
|
||||
.minPointers(2)
|
||||
const devModeTap = Gesture.Tap()
|
||||
.numberOfTaps(5)
|
||||
.onStart(() => {
|
||||
createMock();
|
||||
@@ -38,7 +37,7 @@ const LaunchScreen: React.FC<LaunchScreenProps> = ({}) => {
|
||||
<ExpandableBottomLayout.TopSection backgroundColor={black}>
|
||||
<YStack flex={1} paddingTop="$10">
|
||||
<View style={styles.cardContainer}>
|
||||
<GestureDetector gesture={twoFingerTap}>
|
||||
<GestureDetector gesture={devModeTap}>
|
||||
<LottieView
|
||||
autoPlay={true}
|
||||
loop={false}
|
||||
|
||||
@@ -66,9 +66,8 @@ const PassportNFCScanScreen: React.FC<PassportNFCScanScreenProps> = ({}) => {
|
||||
'PassportNFCMethodSelection',
|
||||
);
|
||||
|
||||
// 5-taps with 2 fingers
|
||||
const twoFingerTap = Gesture.Tap()
|
||||
.minPointers(2)
|
||||
// 5-taps with a single finger
|
||||
const devModeTap = Gesture.Tap()
|
||||
.numberOfTaps(5)
|
||||
.onStart(() => {
|
||||
goToNFCMethodSelection();
|
||||
@@ -316,7 +315,7 @@ const PassportNFCScanScreen: React.FC<PassportNFCScanScreenProps> = ({}) => {
|
||||
) : (
|
||||
<>
|
||||
<TextsContainer>
|
||||
<GestureDetector gesture={twoFingerTap}>
|
||||
<GestureDetector gesture={devModeTap}>
|
||||
<Title>Verify your passport</Title>
|
||||
</GestureDetector>
|
||||
<Description
|
||||
|
||||
@@ -48,9 +48,8 @@ const PassportNFCTrouble: React.FC = () => {
|
||||
flushAnalytics();
|
||||
}, []);
|
||||
|
||||
// 2-finger, 5-tap
|
||||
const twoFingerTap = Gesture.Tap()
|
||||
.minPointers(2)
|
||||
// 5-taps with a single finger
|
||||
const devModeTap = Gesture.Tap()
|
||||
.numberOfTaps(5)
|
||||
.onStart(() => {
|
||||
goToNFCMethodSelection();
|
||||
@@ -61,7 +60,7 @@ const PassportNFCTrouble: React.FC = () => {
|
||||
title="Having trouble scanning your passport?"
|
||||
onDismiss={go}
|
||||
>
|
||||
<GestureDetector gesture={twoFingerTap}>
|
||||
<GestureDetector gesture={devModeTap}>
|
||||
<Caption size="large" color={slate500}>
|
||||
Here are some tips to help you successfully scan the RFID chip::
|
||||
</Caption>
|
||||
|
||||
@@ -136,8 +136,7 @@ const SettingsScreen: React.FC<SettingsScreenProps> = ({}) => {
|
||||
return isDevMode ? [...routes, ...DEBUG_MENU] : routes;
|
||||
}, [isDevMode]);
|
||||
|
||||
const twoFingerTap = Gesture.Tap()
|
||||
.minPointers(2)
|
||||
const devModeTap = Gesture.Tap()
|
||||
.numberOfTaps(5)
|
||||
.onStart(() => {
|
||||
setDevModeOn();
|
||||
@@ -198,7 +197,7 @@ ${deviceInfo.map(([k, v]) => `${k}=${v}`).join('; ')}
|
||||
);
|
||||
const { bottom } = useSafeAreaInsets();
|
||||
return (
|
||||
<GestureDetector gesture={twoFingerTap}>
|
||||
<GestureDetector gesture={devModeTap}>
|
||||
<View backgroundColor={white}>
|
||||
<YStack
|
||||
bg={black}
|
||||
|
||||
Reference in New Issue
Block a user