Skip to content

Commit

Permalink
Merge pull request #37784 from Expensify/andrew-hybrid-app-survey
Browse files Browse the repository at this point in the history
Use mandatory survey on HybridApp in addition to web
  • Loading branch information
roryabraham authored Mar 6, 2024
2 parents 6c320c4 + 97a404d commit 1a545a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
8 changes: 7 additions & 1 deletion src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useEffect} from 'react';
import {View} from 'react-native';
import {NativeModules, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import Icon from '@components//Icon';
Expand Down Expand Up @@ -84,6 +84,12 @@ function ExitSurveyConfirmPage({exitReason, isLoading, route, navigation}: ExitS
text={translate('exitSurvey.goToExpensifyClassic')}
onPress={() => {
ExitSurvey.switchToOldDot();

if (NativeModules.HybridAppModule) {
NativeModules.HybridAppModule.closeReactNativeApp();
return;
}

Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
}}
isLoading={isLoading ?? false}
Expand Down
19 changes: 1 addition & 18 deletions src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useNavigationState} from '@react-navigation/native';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import type {GestureResponderEvent, StyleProp, ViewStyle} from 'react-native';
import {NativeModules, View} from 'react-native';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
Expand Down Expand Up @@ -174,23 +174,6 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa
],
};

if (NativeModules.HybridAppModule) {
const hybridAppMenuItems: MenuData[] = [
{
translationKey: 'initialSettingsPage.returnToClassic' as const,
icon: Expensicons.RotateLeft,
shouldShowRightIcon: true,
iconRight: Expensicons.NewWindow,
action: () => {
NativeModules.HybridAppModule.closeReactNativeApp();
},
},
...defaultMenu.items,
].filter((item) => item.translationKey !== 'initialSettingsPage.signOut' && item.translationKey !== 'exitSurvey.goToExpensifyClassic');

return {sectionStyle: styles.accountSettingsSectionContainer, sectionTranslationKey: 'initialSettingsPage.account', items: hybridAppMenuItems};
}

return defaultMenu;
}, [loginList, fundList, styles.accountSettingsSectionContainer, bankAccountList, userWallet?.errors, walletTerms?.errors, signOut]);

Expand Down

0 comments on commit 1a545a9

Please sign in to comment.