Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guardian Ad-Lite: Thankyou #6657

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
93337fd
fix: simplification fullfillment options
paul-daniel-dempsey Dec 23, 2024
8d88e2f
feat: initial ty components add
paul-daniel-dempsey Dec 23, 2024
e3364d1
feat: ty component content and params
paul-daniel-dempsey Dec 23, 2024
a279b6d
feat: ty component icons removed
paul-daniel-dempsey Dec 23, 2024
4da4139
feat: ty header copy
paul-daniel-dempsey Dec 23, 2024
e247ada
Merge branch 'main' into pd/guardian-light-thankyou
paul-daniel-dempsey Dec 24, 2024
4f6b135
Merge branch 'main' into pd/guardian-light-thankyou
paul-daniel-dempsey Dec 30, 2024
d17eab4
feat: pass through returnLink applied for returnAddress PR
paul-daniel-dempsey Dec 30, 2024
9f02b6c
Merge branch 'pd/guardian-light-thankyou' of github.com:guardian/supp…
paul-daniel-dempsey Dec 30, 2024
818621f
feat: whatNext component signedIn prop added
paul-daniel-dempsey Dec 31, 2024
42c5df5
feat: bulletPointedList point color override added
paul-daniel-dempsey Dec 31, 2024
4354efc
feat: thankyou page states signedIn and NotRegistered completed
paul-daniel-dempsey Dec 31, 2024
99092e4
feat: NotRegistered show Reminder To Activate Subscription
paul-daniel-dempsey Dec 31, 2024
b1a9f7a
feat: NotSignedIn show SignIn To Activate Subscription
paul-daniel-dempsey Dec 31, 2024
7ecb7b8
feat: GuardianAdLight thankyou component text font size reduced
paul-daniel-dempsey Jan 2, 2025
d708aaa
feat: simplified to an address cta thankyou component
paul-daniel-dempsey Jan 2, 2025
cade86a
feat: optional parameters default to false
paul-daniel-dempsey Jan 2, 2025
23c35f8
feat: simplified reminder to activate subscription
paul-daniel-dempsey Jan 3, 2025
f549d17
feat: removed unused comments
paul-daniel-dempsey Jan 3, 2025
49a41fc
review: unnecessary fragment removed
paul-daniel-dempsey Jan 3, 2025
6304d93
review: simplified, isNewAccount replaced with isNotRegistered
paul-daniel-dempsey Jan 3, 2025
77ee060
review: color property added to bulletpoint lists
paul-daniel-dempsey Jan 3, 2025
e2ad065
review: started passing through productKeys
paul-daniel-dempsey Jan 3, 2025
c5a7822
review: productCatalog thankyouMessage
paul-daniel-dempsey Jan 3, 2025
06bbf5b
review: optional color prop drilled through bulletPointedList
paul-daniel-dempsey Jan 3, 2025
7e7f5c3
Merge branch 'main' into pd/guardian-light-thankyou
paul-daniel-dempsey Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { css } from '@emotion/react';
import { from, space } from '@guardian/source/foundations';

const paragraphCheckInbox = css`
font-weight: bold;
margin-top: ${space[5]}px;
${from.tablet} {
margin-top: ${space[6]}px;
}
`;

export function ActivateSubscriptionReminder(): JSX.Element {
return (
<>
<p>
Completing your account set up is required to read with non-personalised
advertising on other devices or browsers and manage your subscription.
</p>
<p css={paragraphCheckInbox}>
Check your inbox, find the email “Complete your Guardian account” and
follow the link to set your password.
</p>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { css } from '@emotion/react';
import { space } from '@guardian/source/foundations';
import {
LinkButton,
SvgArrowRightStraight,
} from '@guardian/source/react-components';

const btnStyleOverrides = css`
justify-content: left;
margin-bottom: ${space[5]}px;
`;

export type AddressCtaProp = {
copy: string;
address: string;
hasArrow?: boolean;
};

export function AddressCta({
address,
copy,
hasArrow = false,
}: AddressCtaProp): JSX.Element {
return (
<>
{hasArrow ? (
<LinkButton
cssOverrides={btnStyleOverrides}
href={address}
size="default"
icon={<SvgArrowRightStraight />}
iconSide="right"
nudgeIcon
aria-label={copy}
>
{copy}
</LinkButton>
) : (
<LinkButton
cssOverrides={btnStyleOverrides}
href={address}
size="default"
aria-label={copy}
>
{copy}
</LinkButton>
)}
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { palette } from '@guardian/source/foundations';
import BulletPointedList from '../utilityComponents/BulletPointedList';

type WhatNextProps = {
amount: string;
startDate: string;
isSignedIn?: boolean;
};

export function WhatNext({
amount,
startDate,
isSignedIn = false,
}: WhatNextProps): JSX.Element {
const bulletItems = [
'You will receive an email confirming the detail of your offer',
`Your payment of £${amount}/month will be taken on ${startDate}`,
];
const bulletPointSignedIn = bulletItems.concat([
'You can now start reading the Guardian on this device in a reject all state',
]);
return (
<BulletPointedList
items={isSignedIn ? bulletPointSignedIn : bulletItems}
color={palette.neutral[7]}
/>
);
}
41 changes: 32 additions & 9 deletions support-frontend/assets/components/thankYou/thankYouModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ const defaultGridContainer = css`
}
`;

const defaultContainerNoIcon = css`
margin: ${space[3]}px ${space[2]}px;
${until.tablet} {
margin-top: ${space[0]}px;
}
`;

const imageryAndQrCodesGridContainer = css`
display: grid;
grid-column-gap: ${space[3]}px;
Expand Down Expand Up @@ -131,11 +138,11 @@ const bodyStyle = css`
}
`;

const bodyCopyStyle = css`
const bodyCopyStyle = (isGuardianAdLite: boolean) => css`
${textEgyptian15};
margin-bottom: ${space[1]}px;
${from.tablet} {
${textEgyptian17};
${isGuardianAdLite ? textEgyptian15 : textEgyptian17};
}
`;
const bodyCopyMarginTop = css`
Expand Down Expand Up @@ -175,7 +182,7 @@ const qrCodesContainer = css`

const paddingRight = css`
${from.tablet} {
padding-right: 72px;
padding-right: 54px;
}
`;
const paddingRightApps = css`
Expand Down Expand Up @@ -226,14 +233,19 @@ export type ThankYouModuleType =
| 'supportReminder'
| 'benefits'
| 'subscriptionStart'
| 'newspaperArchiveBenefit';
| 'newspaperArchiveBenefit'
| 'whatNext'
| 'reminderToSignIn'
| 'reminderToActivateSubscription'
| 'headlineReturn'
| 'signInToActivate';

export interface ThankYouModuleProps {
icon: JSX.Element;
header: string;
bodyCopy: JSX.Element | string;
ctas: JSX.Element | null;
moduleType: ThankYouModuleType;
icon?: JSX.Element;
isSignedIn?: boolean;
trackComponentLoadId?: string;
bodyCopySecond?: JSX.Element | string;
Expand All @@ -255,6 +267,13 @@ function ThankYouModule({
trackComponentLoadId && trackComponentLoad(trackComponentLoadId);
}, []);

const isGuardianAdLite = [
'whatNext',
'reminderToSignIn',
'reminderToActivateSubscription',
'headlineReturn',
'signInToActivate',
].includes(moduleType);
const hasQrCodes = moduleType === 'appDownload';
const isDownloadModules = moduleType === 'appsDownload';
const hasImagery = ['appDownload', 'newspaperArchiveBenefit'].includes(
Expand All @@ -264,7 +283,9 @@ function ThankYouModule({
const gridContainer =
hasImagery || hasQrCodes
? imageryAndQrCodesGridContainer
: defaultGridContainer;
: icon
? defaultGridContainer
: defaultContainerNoIcon;

const maybePaddingRight =
!hasImagery && (isDownloadModules ? paddingRightApps : paddingRight);
Expand All @@ -290,7 +311,7 @@ function ThankYouModule({
<>
<div css={[bodyApps, bodyAppsTop]}>
<div css={bodyStyle}>
<p css={bodyCopyStyle}>{bodyCopy}</p>
<p css={bodyCopyStyle(isGuardianAdLite)}>{bodyCopy}</p>
<div css={[ctaContainerApps, ctaTop]}>{ctas}</div>
</div>
<span css={appContainer}>
Expand All @@ -299,7 +320,7 @@ function ThankYouModule({
</div>
<div css={bodyApps}>
<div css={bodyStyle}>
<p css={bodyCopyStyle}>{bodyCopySecond}</p>
<p css={bodyCopyStyle(isGuardianAdLite)}>{bodyCopySecond}</p>
<div css={[ctaContainerApps, ctaBottom]}>{ctasSecond}</div>
</div>
<span css={appContainer}>
Expand All @@ -309,7 +330,9 @@ function ThankYouModule({
</>
) : (
<>
<p css={[bodyCopyStyle, bodyCopyMarginTop]}>{bodyCopy}</p>
<p css={[bodyCopyStyle(isGuardianAdLite), bodyCopyMarginTop]}>
{bodyCopy}
</p>
<div css={resizeMarginTop}>{ctas}</div>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
OPHAN_COMPONENT_ID_SOCIAL,
OPHAN_COMPONENT_ID_SURVEY,
} from 'helpers/thankYouPages/utils/ophan';
import { manageSubsUrl } from 'helpers/urls/externalLinks';
import {
formatMachineDate,
formatUserDate,
Expand All @@ -51,6 +52,9 @@ import {
FeedbackCTA,
getFeedbackHeader,
} from './feedback/FeedbackItems';
import { ActivateSubscriptionReminder } from './guardianAdLite/activateSubscriptionReminder';
import { AddressCta } from './guardianAdLite/addressCta';
import { WhatNext } from './guardianAdLite/whatNext';
import { SignInBodyCopy, SignInCTA, signInHeader } from './signIn/signInItems';
import { SignUpBodyCopy, signUpHeader } from './signUp/signUpItems';
import {
Expand All @@ -72,10 +76,10 @@ import type { ThankYouModuleType } from './thankYouModule';
import { getThankYouModuleIcon } from './thankYouModuleIcons';

export interface ThankYouModuleData {
icon: JSX.Element;
header: string;
bodyCopy: string | JSX.Element;
ctas: JSX.Element | null;
icon?: JSX.Element;
trackComponentLoadId?: string;
bodyCopySecond?: string | JSX.Element;
ctasSecond?: JSX.Element | null;
Expand Down Expand Up @@ -112,6 +116,10 @@ export const getThankYouModuleData = (
checklistData?: BenefitsCheckListData[],
supportReminder?: ThankYouSupportReminderState,
feedbackSurveyHasBeenCompleted?: boolean,
finalAmount?: number,
startDate?: string,
returnAddress?: string,
isSignedIn?: boolean,
): Record<ThankYouModuleType, ThankYouModuleData> => {
const initialFeedbackSurveyHasBeenCompleted =
feedbackSurveyHasBeenCompleted ?? defaultFeedbackSurveyHasBeenCompleted;
Expand Down Expand Up @@ -318,6 +326,66 @@ export const getThankYouModuleData = (
/>
),
},
whatNext: {
header: 'What happens next?',
bodyCopy: (
<WhatNext
amount={(finalAmount ?? '').toString()}
startDate={startDate ?? ''}
isSignedIn={isSignedIn}
/>
),
ctas: null,
},
reminderToSignIn: {
header: 'Important reminder',
bodyCopy: (
<p>
To enjoy reading the Guardian with non-personalised advertising on all
your devices. please remember to sign in on each device or browser
session. This will ensure you to read with non-personalised
advertising no matter where you log in.
</p>
),
ctas: null,
},
reminderToActivateSubscription: {
header:
'Almost there! Complete your Guardian account to activate your subscription',
bodyCopy: <ActivateSubscriptionReminder />,
ctas: null,
},
headlineReturn: {
header: 'Headline to bring user back to Guardian front page',
bodyCopy: (
<p>
Copy to prompt users to enjoy the Guardian with non personalised
advertising
</p>
),
ctas: (
<AddressCta
address={returnAddress ?? ''}
copy={'Continue to the Guardian'}
hasArrow={true}
/>
),
},
signInToActivate: {
header: 'Almost there! Sign in to activate your subscription',
bodyCopy: (
<p>
To be able to read the Guardian with non-personalised advertising you
must be signed in on all your devices.'
</p>
),
ctas: (
<AddressCta
address={manageSubsUrl}
copy={'Sign in and activate your subscription'}
/>
),
},
};

return thankYouModuleData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ const list = css`
margin-top: ${space[4]}px;
}
`;

type SvgBulletProps = {
color?: string;
};
type BulletPointedListItemProps = {
item: string;
color?: string;
};
type BulletPointedListProps = {
items: string[];
color?: string;
};

function SvgBullet() {
function SvgBullet({ color = palette.brand[500] }: SvgBulletProps) {
return (
<svg
width="8"
Expand All @@ -30,27 +36,27 @@ function SvgBullet() {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="4" cy="4" r="4" fill={`${palette.brand[500]}`} />
<circle cx="4" cy="4" r="4" fill={`${color}`} />
</svg>
);
}

function BulletPointedListItem({ item }: BulletPointedListItemProps) {
function BulletPointedListItem({ item, color }: BulletPointedListItemProps) {
return (
<li css={listItem}>
<div>
<SvgBullet />
<SvgBullet color={color} />
</div>
<div>{item}</div>
</li>
);
}

function BulletPointedList({ items }: BulletPointedListProps) {
function BulletPointedList({ items, color }: BulletPointedListProps) {
return (
<ul css={list}>
{items.map((item) => (
<BulletPointedListItem key={item} item={item} />
<BulletPointedListItem key={item} item={item} color={color} />
))}
</ul>
);
Expand Down
Loading
Loading