|
4 | 4 | } from '@metamask/transaction-controller'; |
5 | 5 | import React, { useCallback, useState } from 'react'; |
6 | 6 | import { useDispatch, useSelector } from 'react-redux'; |
| 7 | +import { PRODUCT_TYPES } from '@metamask/subscription-controller'; |
7 | 8 | import { MetaMetricsEventLocation } from '../../../../../../shared/constants/metametrics'; |
8 | 9 | import { isCorrectDeveloperTransactionType } from '../../../../../../shared/lib/confirmation.utils'; |
9 | 10 | import { ConfirmAlertModal } from '../../../../../components/app/alert-system/confirm-alert-modal'; |
@@ -38,6 +39,7 @@ import { |
38 | 39 | } from '../../../hooks/useAddEthereumChain'; |
39 | 40 | import { isSignatureTransactionType } from '../../../utils'; |
40 | 41 | import { getConfirmationSender } from '../utils'; |
| 42 | +import { useUserSubscriptions } from '../../../../../hooks/subscription/useSubscription'; |
41 | 43 | import OriginThrottleModal from './origin-throttle-modal'; |
42 | 44 | import ShieldFooterAgreement from './shield-footer-agreement'; |
43 | 45 | import ShieldFooterCoverageIndicator from './shield-footer-coverage-indicator/shield-footer-coverage-indicator'; |
@@ -117,6 +119,9 @@ const ConfirmButton = ({ |
117 | 119 | setConfirmModalVisible(true); |
118 | 120 | }, []); |
119 | 121 |
|
| 122 | + const { trialedProducts } = useUserSubscriptions(); |
| 123 | + const isShieldTrialed = trialedProducts?.includes(PRODUCT_TYPES.SHIELD); |
| 124 | + |
120 | 125 | return ( |
121 | 126 | <> |
122 | 127 | {confirmModalVisible && ( |
@@ -157,7 +162,11 @@ const ConfirmButton = ({ |
157 | 162 | > |
158 | 163 | {currentConfirmation?.type === |
159 | 164 | TransactionType.shieldSubscriptionApprove |
160 | | - ? t('shieldStartNowCTA') |
| 165 | + ? t( |
| 166 | + isShieldTrialed |
| 167 | + ? 'shieldStartNowCTA' |
| 168 | + : 'shieldStartNowCTAWithTrial', |
| 169 | + ) |
161 | 170 | : t('confirm')} |
162 | 171 | </Button> |
163 | 172 | )} |
|
0 commit comments