From 4e0337d53cb70c3b0a5fe23d9be71ea633a29fa9 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Fri, 2 Aug 2024 11:22:38 +0200 Subject: [PATCH] Adjust props of explanation modal --- src/components/ExplanationModal.tsx | 4 ++-- src/components/FeatureTrainingModal.tsx | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/ExplanationModal.tsx b/src/components/ExplanationModal.tsx index cf42c1d942c9..c6294f600993 100644 --- a/src/components/ExplanationModal.tsx +++ b/src/components/ExplanationModal.tsx @@ -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. @@ -32,7 +32,7 @@ function ExplanationModal() { secondaryDescription={translate('onboarding.explanationModal.secondaryDescription')} confirmText={translate('footer.getStarted')} videoURL={CONST.WELCOME_VIDEO_URL} - onConfirm={onConfirm} + onClose={onClose} /> ); } diff --git a/src/components/FeatureTrainingModal.tsx b/src/components/FeatureTrainingModal.tsx index d204567eee31..3220b6d28730 100644 --- a/src/components/FeatureTrainingModal.tsx +++ b/src/components/FeatureTrainingModal.tsx @@ -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; @@ -80,6 +83,7 @@ function FeatureTrainingModal({ shouldShowDismissModalOption = false, confirmText = '', onConfirm = () => {}, + onClose = () => {}, helpText = '', onHelp = () => {}, }: FeatureTrainingModalProps) { @@ -166,7 +170,8 @@ function FeatureTrainingModal({ } setIsModalVisible(false); Navigation.goBack(); - }, [willShowAgain]); + onClose?.(); + }, [onClose, willShowAgain]); const closeAndConfirmModal = useCallback(() => { closeModal();