Skip to content

Commit 5460146

Browse files
authored
Soft Opt-in Thank You pages Heading copy (#7035)
* converge all header messages to legitima interest message. * clean up unecessary subheding functions * clean subheading uneeded decision branches * more declaretive way of choosing sub heading messages * exclude all subcription cards from render startDate component * use guardianWeekly from product matcher * update direct debit message copy
1 parent e73bb27 commit 5460146

File tree

9 files changed

+148
-269
lines changed

9 files changed

+148
-269
lines changed

support-frontend/assets/pages/[countryGroupId]/components/thankYouComponent.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,17 +359,14 @@ export function ThankYouComponent({
359359
<Container>
360360
<div css={headerContainer}>
361361
<ThankYouHeader
362-
isSignedIn={isSignedIn}
363362
productKey={productKey}
364363
ratePlanKey={ratePlanKey}
365364
name={order.firstName}
366365
amount={payment.originalAmount}
367-
amountIsAboveThreshold={isSupporterPlus}
368366
isOneOffPayPal={isOneOffPayPal}
369-
showDirectDebitMessage={order.paymentMethod === 'DirectDebit'}
367+
isDirectDebitPayment={order.paymentMethod === 'DirectDebit'}
370368
currency={currencyKey}
371369
promotion={promotion}
372-
identityUserType={identityUserType}
373370
observerPrint={observerPrint}
374371
paymentStatus={order.status}
375372
startDate={startDate}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { css } from '@emotion/react';
2+
import { space } from '@guardian/source/foundations';
3+
4+
const bold = css`
5+
font-weight: bold;
6+
`;
7+
8+
const directDebitMessage = css`
9+
margin-bottom: ${space[2]}px;
10+
`;
11+
12+
function DirectDebitMessage({
13+
mediaGroup,
14+
}: {
15+
mediaGroup: string;
16+
}): JSX.Element {
17+
return (
18+
<div css={directDebitMessage}>
19+
<strong css={bold}>Your Direct Debit has been set up. </strong>
20+
You will receive an email within three business days confirming your
21+
recurring payment. This will appear as '{mediaGroup}' on your bank
22+
statements.
23+
</div>
24+
);
25+
}
26+
27+
export default DirectDebitMessage;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Link } from '@guardian/source/react-components';
2+
3+
export default function LegitimateInterestMessage({
4+
showPaymentStatus,
5+
}: {
6+
showPaymentStatus: boolean;
7+
}): JSX.Element {
8+
const status = 'Your payment is being processed. ';
9+
return (
10+
<p>
11+
{showPaymentStatus && status}Look out for your exclusive newsletter from
12+
our supporter editor, plus emails to help you manage and get the most out
13+
of your support. Adjust your email preferences at any time via{' '}
14+
<Link href="https://manage.theguardian.com/">your account</Link>.
15+
</p>
16+
);
17+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ObserverPrint } from 'pages/paper-subscription-landing/helpers/products';
2+
3+
export default function ObserverMessage({
4+
observerPrint,
5+
}: {
6+
observerPrint: ObserverPrint;
7+
}) {
8+
if (observerPrint === ObserverPrint.SubscriptionCard) {
9+
return (
10+
<p>
11+
You should receive your subscription card in 1-2 weeks, but look out for
12+
an email landing in your inbox later today containing details of how you
13+
can pick up your newspaper before then.
14+
</p>
15+
);
16+
}
17+
return null;
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {
2+
type ActiveProductKey,
3+
productCatalogDescription,
4+
} from 'helpers/productCatalog';
5+
6+
interface ProductCatalogMessage {
7+
productKey: ActiveProductKey;
8+
}
9+
10+
export default function ProductCatalogMessage({
11+
productKey,
12+
}: ProductCatalogMessage) {
13+
const { thankyouMessage } = productCatalogDescription[productKey];
14+
if (!thankyouMessage) {
15+
return null;
16+
}
17+
return <p>{thankyouMessage}</p>;
18+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { css } from '@emotion/react';
2+
import { space } from '@guardian/source/foundations';
3+
import type { ActiveProductKey } from 'helpers/productCatalog';
4+
import { isGuardianWeeklyProduct } from './utils/productMatchers';
5+
6+
const startDateStyle = css`
7+
margin-bottom: ${space[2]}px;
8+
`;
9+
10+
export default function StartDateMessage({
11+
productKey,
12+
startDate,
13+
}: {
14+
startDate?: string;
15+
productKey: ActiveProductKey;
16+
}) {
17+
if (!startDate) {
18+
return null;
19+
}
20+
21+
const deliveryMessage = isGuardianWeeklyProduct(productKey)
22+
? 'Your first issue will be published on'
23+
: 'You will receive your newspapers from';
24+
25+
return (
26+
<p css={startDateStyle}>
27+
{deliveryMessage} {startDate}.
28+
</p>
29+
);
30+
}

support-frontend/assets/pages/supporter-plus-thank-you/components/thankYouHeader/directDebitMessage.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

support-frontend/assets/pages/supporter-plus-thank-you/components/thankYouHeader/subheading.tsx

Lines changed: 0 additions & 204 deletions
This file was deleted.

0 commit comments

Comments
 (0)