Skip to content

Commit

Permalink
Merge pull request Expensify#46704 from software-mansion-labs/fix-beh…
Browse files Browse the repository at this point in the history
…avior-of-explanation-modal

[HybridApp] Adjust props of explanation modal
  • Loading branch information
AndrewGable authored Aug 5, 2024
2 parents e909496 + 4e0337d commit a4e5a52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/ExplanationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import FeatureTrainingModal from './FeatureTrainingModal';
function ExplanationModal() {
const {translate} = useLocalize();

const onConfirm = useCallback(() => {
const onClose = useCallback(() => {
Welcome.completeHybridAppOnboarding();

// We need to check if standard NewDot onboarding is completed.
Expand All @@ -32,7 +32,7 @@ function ExplanationModal() {
secondaryDescription={translate('onboarding.explanationModal.secondaryDescription')}
confirmText={translate('footer.getStarted')}
videoURL={CONST.WELCOME_VIDEO_URL}
onConfirm={onConfirm}
onClose={onClose}
/>
);
}
Expand Down
7 changes: 6 additions & 1 deletion src/components/FeatureTrainingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ type FeatureTrainingModalProps = {
/** A callback to call when user confirms the tutorial */
onConfirm?: () => void;

/** A callback to call when modal closes */
onClose?: () => void;

/** Text to show on secondary button */
helpText?: string;

Expand All @@ -80,6 +83,7 @@ function FeatureTrainingModal({
shouldShowDismissModalOption = false,
confirmText = '',
onConfirm = () => {},
onClose = () => {},
helpText = '',
onHelp = () => {},
}: FeatureTrainingModalProps) {
Expand Down Expand Up @@ -166,7 +170,8 @@ function FeatureTrainingModal({
}
setIsModalVisible(false);
Navigation.goBack();
}, [willShowAgain]);
onClose?.();
}, [onClose, willShowAgain]);

const closeAndConfirmModal = useCallback(() => {
closeModal();
Expand Down

0 comments on commit a4e5a52

Please sign in to comment.