Skip to content

Commit 069707b

Browse files
author
Richard Bangay
committed
move the cancel sub/support button from the manage product page to the account overview for US customers
1 parent 1eade1e commit 069707b

File tree

4 files changed

+79
-33
lines changed

4 files changed

+79
-33
lines changed

client/components/mma/accountoverview/ManageProduct.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,14 @@ const InnerContent = ({
382382
/>
383383
)}
384384

385-
{!hasCancellationPending && (
386-
<CancellationCTA
387-
productDetail={productDetail}
388-
friendlyName={groupedProductType.friendlyName}
389-
specificProductType={specificProductType}
390-
/>
391-
)}
385+
{!hasCancellationPending &&
386+
productDetail.billingCountry !== 'United States' && (
387+
<CancellationCTA
388+
productDetail={productDetail}
389+
friendlyName={groupedProductType.friendlyName}
390+
specificProductType={specificProductType}
391+
/>
392+
)}
392393
</>
393394
);
394395
};

client/components/mma/accountoverview/ProductCard.tsx

+48
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,54 @@ export const ProductCard = ({
566566
</p>
567567
</Card.Section>
568568
)}
569+
{productDetail.billingCountry === 'United States' &&
570+
!hasCancellationPending && (
571+
<Card.Section>
572+
<div css={productDetailLayoutCss}>
573+
<div>
574+
<h4 css={sectionHeadingCss}>
575+
Cancel {groupedProductType.friendlyName}
576+
</h4>
577+
<p
578+
css={css`
579+
max-width: 350px;
580+
`}
581+
>
582+
Stop your recurring payment, at the end
583+
of current billing period.
584+
</p>
585+
</div>
586+
<div css={wideButtonLayoutCss}>
587+
<Button
588+
aria-label={`Cancel ${specificProductType.productTitle(
589+
mainPlan,
590+
)}`}
591+
size="small"
592+
cssOverrides={css`
593+
justify-content: center;
594+
`}
595+
priority="primary"
596+
onClick={() => {
597+
trackEvent({
598+
eventCategory:
599+
'account_overview',
600+
eventAction: 'click',
601+
eventLabel: 'cancel_product',
602+
});
603+
navigate(
604+
`/cancel/${specificProductType.urlPart}`,
605+
{
606+
state: { productDetail },
607+
},
608+
);
609+
}}
610+
>
611+
Cancel {groupedProductType.friendlyName}
612+
</Button>
613+
</div>
614+
</div>
615+
</Card.Section>
616+
)}
569617
</Card>
570618
</Stack>
571619
);

client/components/mma/accountoverview/manageProducts/ManageProductV2.tsx

+22-25
Original file line numberDiff line numberDiff line change
@@ -248,32 +248,29 @@ const InnerContent = ({
248248
</LinkButton>
249249
)}
250250

251-
<div
252-
css={css`
253-
margin-left: ${space[5]}px;
254-
`}
255-
>
256-
{!hasCancellationPending &&
257-
isSelfServeCancellationAllowed && (
258-
<Button
259-
priority="subdued"
260-
onClick={() => {
261-
navigate(
262-
'/cancel/' +
263-
specificProductType.urlPart,
264-
{
265-
state: {
266-
productDetail:
267-
productDetail,
268-
},
251+
{!hasCancellationPending &&
252+
isSelfServeCancellationAllowed &&
253+
productDetail.billingCountry !== 'United States' && (
254+
<Button
255+
priority="subdued"
256+
onClick={() => {
257+
navigate(
258+
'/cancel/' +
259+
specificProductType.urlPart,
260+
{
261+
state: {
262+
productDetail: productDetail,
269263
},
270-
);
271-
}}
272-
>
273-
Cancel {groupedProductType.friendlyName}
274-
</Button>
275-
)}
276-
</div>
264+
},
265+
);
266+
}}
267+
cssOverrides={css`
268+
margin-left: ${space[5]}px;
269+
`}
270+
>
271+
Cancel {groupedProductType.friendlyName}
272+
</Button>
273+
)}
277274
</div>
278275
</section>
279276
</>

client/styles/ButtonStyles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const wideButtonCss = css`
8585
export const wideButtonLayoutCss = css`
8686
display: flex;
8787
flex-direction: column;
88-
justify-content: flex-end;
88+
justify-content: flex-start;
8989
9090
> * + * {
9191
margin-top: ${space[3]}px;

0 commit comments

Comments
 (0)