Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HybridApp] Adjust props of explanation modal #46704

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading