-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathTrialPaymentReminderModalManager.tsx
More file actions
35 lines (29 loc) · 1.09 KB
/
TrialPaymentReminderModalManager.tsx
File metadata and controls
35 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, {useCallback} from 'react';
import useTrialPaymentReminder from '@hooks/useTrialPaymentReminder';
import Navigation from '@libs/Navigation/Navigation';
import ROUTES from '@src/ROUTES';
import TrialPaymentReminderModal from './TrialPaymentReminderModal';
function TrialPaymentReminderModalManager() {
const {shouldShowModal, currentVariation, countdownTime, dismiss} = useTrialPaymentReminder();
const handleClose = useCallback(() => {
dismiss();
}, [dismiss]);
const handleAddPaymentCard = useCallback(() => {
dismiss();
Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD);
}, [dismiss]);
if (!currentVariation) {
return null;
}
return (
<TrialPaymentReminderModal
isVisible={shouldShowModal}
variant={currentVariation.variant}
daysRemaining={currentVariation.daysRemaining}
countdownTime={countdownTime}
onClose={handleClose}
onAddPaymentCard={handleAddPaymentCard}
/>
);
}
export default TrialPaymentReminderModalManager;