Skip to content

Commit 05cfcb2

Browse files
blimpichOSBotify
authored andcommitted
Merge pull request #60856 from allroundexperts/fix-60828
(cherry picked from commit a329cec) (CP triggered by AndrewGable)
1 parent e3dc577 commit 05cfcb2

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

src/pages/OnboardingPersonalDetails/index.native.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1-
import React from 'react';
1+
import {useFocusEffect} from '@react-navigation/native';
2+
import React, {useCallback} from 'react';
3+
import {BackHandler} from 'react-native';
24
import BaseOnboardingPersonalDetails from './BaseOnboardingPersonalDetails';
35
import type {OnboardingPersonalDetailsProps} from './types';
46

57
function OnboardingPersonalDetails({...rest}: OnboardingPersonalDetailsProps) {
8+
const {index: routeIndex} = rest.navigation.getState();
9+
10+
// To block android native back button behavior
11+
useFocusEffect(
12+
useCallback(() => {
13+
// We don't want to block the back button if this is not the first route
14+
if (routeIndex !== 0) {
15+
return;
16+
}
17+
18+
// Return true to indicate that the back button press is handled here
19+
const backAction = () => true;
20+
21+
const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);
22+
23+
return () => backHandler.remove();
24+
}, [routeIndex]),
25+
);
26+
627
return (
728
<BaseOnboardingPersonalDetails
829
shouldUseNativeStyles

src/pages/OnboardingPrivateDomain/BaseOnboardingPrivateDomain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function BaseOnboardingPrivateDomain({shouldUseNativeStyles, route}: BaseOnboard
7575
onBackButtonPress={Navigation.goBack}
7676
/>
7777
<View style={[styles.flex1, onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5, styles.justifyContentBetween]}>
78-
<View>
78+
<View style={[styles.flexGrow1, styles.mb5]}>
7979
<Text style={styles.textHeadlineH1}>{translate('onboarding.peopleYouMayKnow')}</Text>
8080
<Text style={[styles.textAlignLeft, styles.mt5]}>{translate('onboarding.workspaceYouMayJoin', {domain, email})}</Text>
8181
<ValidateCodeForm

0 commit comments

Comments
 (0)