Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into fix/33797
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony-MK authored Jan 31, 2024
2 parents f4f1d63 + 9a0289b commit bcbd4e6
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/PurposeForUsingExpensifyModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {useNavigation} from '@react-navigation/native';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {ScrollView, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import useLocalize from '@hooks/useLocalize';
import useStyleUtils from '@hooks/useStyleUtils';
Expand All @@ -11,6 +13,7 @@ import * as Report from '@userActions/Report';
import * as Welcome from '@userActions/Welcome';
import CONST from '@src/CONST';
import NAVIGATORS from '@src/NAVIGATORS';
import ONYXKEYS from '@src/ONYXKEYS';
import SCREENS from '@src/SCREENS';
import HeaderWithBackButton from './HeaderWithBackButton';
import * as Expensicons from './Icon/Expensicons';
Expand Down Expand Up @@ -78,8 +81,12 @@ const menuIcons = {
[CONST.INTRO_CHOICES.MANAGE_TEAM]: Expensicons.MoneyBag,
[CONST.INTRO_CHOICES.CHAT_SPLIT]: Expensicons.Briefcase,
};
type PurposeForUsingExpensifyModalOnyxProps = {
isLoadingApp: OnyxEntry<boolean>;
};
type PurposeForUsingExpensifyModalProps = PurposeForUsingExpensifyModalOnyxProps;

function PurposeForUsingExpensifyModal() {
function PurposeForUsingExpensifyModal({isLoadingApp = false}: PurposeForUsingExpensifyModalProps) {
const {translate} = useLocalize();
const StyleUtils = useStyleUtils();
const styles = useThemeStyles();
Expand All @@ -98,7 +105,7 @@ function PurposeForUsingExpensifyModal() {

Welcome.show(routes, () => setIsModalOpen(true));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [isLoadingApp]);

const closeModal = useCallback(() => {
Report.dismissEngagementModal();
Expand Down Expand Up @@ -174,5 +181,8 @@ function PurposeForUsingExpensifyModal() {
}

PurposeForUsingExpensifyModal.displayName = 'PurposeForUsingExpensifyModal';

export default PurposeForUsingExpensifyModal;
export default withOnyx<PurposeForUsingExpensifyModalProps, PurposeForUsingExpensifyModalOnyxProps>({
isLoadingApp: {
key: ONYXKEYS.IS_LOADING_APP,
},
})(PurposeForUsingExpensifyModal);

0 comments on commit bcbd4e6

Please sign in to comment.