@@ -37,7 +37,9 @@ interface Subscription {
3737 nextInvoiceTotal ?: number ;
3838 nextPromotionName ?: string | null ;
3939 promotionName ?: string | null ;
40+ isEligibleForChurnCancel : boolean ;
4041 isEligibleForChurnStaySubscribed : boolean ;
42+ isEligibleForOffer : boolean ;
4143 churnStaySubscribedCtaMessage ?: string | null ;
4244}
4345
@@ -58,6 +60,9 @@ export const SubscriptionContent = ({
5860 currentInvoiceTotal,
5961 currentInvoiceUrl,
6062 currentPeriodEnd,
63+ isEligibleForChurnCancel,
64+ isEligibleForChurnStaySubscribed,
65+ isEligibleForOffer,
6166 nextInvoiceTax,
6267 nextInvoiceTotal,
6368 nextPromotionName,
@@ -250,9 +255,7 @@ export const SubscriptionContent = ({
250255 </ div >
251256
252257 < div >
253- < p >
254- { subscription . churnStaySubscribedCtaMessage }
255- </ p >
258+ < p > { subscription . churnStaySubscribedCtaMessage } </ p >
256259 < LinkExternal
257260 href = { `/${ locale } /${ subscription . offeringApiIdentifier } /${ subscription . interval } /stay_subscribed/loyalty-discount/terms` }
258261 className = "w-fit text-sm text-blue-500 underline hover:text-blue-600"
@@ -262,7 +265,7 @@ export const SubscriptionContent = ({
262265 'View coupon terms and restrictions'
263266 ) }
264267 >
265- < Localized id = ' subscription-content-link-churn-intervention-terms-apply' >
268+ < Localized id = " subscription-content-link-churn-intervention-terms-apply" >
266269 < span > Terms apply</ span >
267270 </ Localized >
268271 </ LinkExternal >
@@ -272,7 +275,11 @@ export const SubscriptionContent = ({
272275 < div className = "ms-auto w-full tablet:w-auto" >
273276 { canResubscribe ? (
274277 < Link
275- href = { `/${ locale } /subscriptions/${ subscription . id } /stay-subscribed` }
278+ href = {
279+ isEligibleForChurnStaySubscribed
280+ ? `/${ locale } /subscriptions/${ subscription . id } /loyalty-discount/stay-subscribed`
281+ : `/${ locale } /subscriptions/${ subscription . id } /stay-subscribed`
282+ }
276283 className = "border box-border flex font-bold font-header h-10 items-center justify-center rounded-md py-2 px-5 bg-blue-500 hover:bg-blue-700 text-white w-full tablet:w-auto"
277284 aria-label = { `Stay subscribed to ${ productName } ` }
278285 >
@@ -285,7 +292,13 @@ export const SubscriptionContent = ({
285292 </ Link >
286293 ) : (
287294 < Link
288- href = { `/${ locale } /subscriptions/${ subscription . id } /cancel` }
295+ href = {
296+ isEligibleForChurnCancel
297+ ? `/${ locale } /subscriptions/${ subscription . id } /loyalty-discount/cancel`
298+ : isEligibleForOffer
299+ ? `/${ locale } /subscriptions/${ subscription . id } /offer`
300+ : `/${ locale } /subscriptions/${ subscription . id } /cancel`
301+ }
289302 className = "border border-grey-200 box-border flex font-bold font-header h-10 items-center justify-center rounded-md py-2 px-5 bg-grey-10 hover:bg-grey-50 w-full tablet:w-auto"
290303 aria-label = { `Cancel your subscription to ${ productName } ` }
291304 >
0 commit comments