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

Add 3 x benefit CTAs to Account Overview for readers with a digital + print sub #1374

Merged
merged 26 commits into from
Nov 20, 2024
Merged
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
184bfbb
WIP add news archive, news and feast app cts's to the account overvie…
Aug 15, 2024
3a59c91
Add story for NewspaperArchiveCta
tjmw Aug 30, 2024
1cc5d8d
Increase image max-width at >= tablet
tjmw Aug 30, 2024
d4d03ac
Set spacing between flex items
tjmw Aug 30, 2024
2d3522a
Update copy (from Figma)
tjmw Aug 30, 2024
8ec532d
Add stories for these two cta components
tjmw Aug 30, 2024
076df30
Apply same layout tweaks already made to newspaper archive CTA
tjmw Aug 30, 2024
18d9530
Add gradient background to hero image on mobile
tjmw Aug 30, 2024
2fe282b
Same changes to Feast CTA
tjmw Aug 30, 2024
daeb846
Fix horizontal alignment of hero image
tjmw Aug 30, 2024
e7a85c3
Add linear gradient to news app CTA
tjmw Aug 30, 2024
14377ea
Use flex-grow instead of width 100%
tjmw Aug 30, 2024
f542337
Oops accidentally reverted the copy
tjmw Aug 30, 2024
6a763b8
Prevent images from overflowing the container on mobile
tjmw Aug 30, 2024
357259f
Update bg colours and text sizing
tjmw Sep 5, 2024
a36ff74
Update copy
tjmw Sep 5, 2024
b5fbf40
Update archive URL
tjmw Sep 5, 2024
fbe3e03
Remove inconsistent padding at >= tablet on news app copy container
tjmw Sep 5, 2024
a052f35
Reduce size of Newspaper Archive CTA
tjmw Sep 5, 2024
2972a15
Open the Newspaper Archive in a new tab
tjmw Sep 6, 2024
d7e384e
New images from Helene
tjmw Sep 6, 2024
1288242
Use different image on mobile
tjmw Sep 9, 2024
1e23802
Ensure these images are anchored to the bottom of the container
tjmw Sep 9, 2024
ba5b883
New newspaper archive mobile image from Noemi
tjmw Sep 24, 2024
55e47ef
Fix story
tjmw Oct 7, 2024
6e4595c
place the newspaper archive CTA behind a feature flag
Nov 19, 2024
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
21 changes: 21 additions & 0 deletions client/components/mma/accountoverview/AccountOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ import { isCancelled } from '../cancel/CancellationSummary';
import { PageContainer } from '../Page';
import { JsonResponseHandler } from '../shared/asyncComponents/DefaultApiResponseHandler';
import { DefaultLoadingView } from '../shared/asyncComponents/DefaultLoadingView';
import { DownloadAppCtaVariation1 } from '../shared/DownloadAppCtaVariation1';
import { DownloadFeastAppCtaWithImage } from '../shared/DownloadFeastAppCtaWithImage';
import type { IsFromAppProps } from '../shared/IsFromAppProps';
import { NewspaperArchiveCta } from '../shared/NewspaperArchiveCta';
import { nonServiceableCountries } from '../shared/NonServiceableCountries';
import { PaymentFailureAlertIfApplicable } from '../shared/PaymentFailureAlertIfApplicable';
import { CancelledProductCard } from './CancelledProductCard';
Expand Down Expand Up @@ -166,6 +169,10 @@ const AccountOverviewPage = ({ isFromApp }: IsFromAppProps) => {
isSpecificProductType(productDetail, PRODUCT_TYPES.digipack),
);

const hasDigitalPlusPrint = allActiveProductDetails.some((productDetail) =>
isSpecificProductType(productDetail, PRODUCT_TYPES.tierthree),
);

const hasNonServiceableCountry = nonServiceableCountries.includes(
allActiveProductDetails.find(isProduct)?.billingCountry as string,
);
Expand Down Expand Up @@ -290,6 +297,20 @@ const AccountOverviewPage = ({ isFromApp }: IsFromAppProps) => {
</Fragment>
);
})}
{hasDigitalPlusPrint && (
<>
<h2 css={subHeadingCss}>
Get the most out of your benefits
</h2>
<Stack space={6}>
{featureSwitches.digitalArchiveCta && (
<NewspaperArchiveCta />
)}
<DownloadAppCtaVariation1 />
<DownloadFeastAppCtaWithImage />
</Stack>
</>
)}
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type { PaidSubscriptionPlan } from '@/shared/productResponse';
import { getMainPlan } from '@/shared/productResponse';
import { BenefitsSection } from '../../shared/benefits/BenefitsSection';
import { DownloadAppCta } from '../../shared/DownloadAppCta';
import { DownloadFeastAppCta } from '../../shared/DownloadFeastAppCta';
import { DownloadFeastAppCtaWithIcon } from '../../shared/DownloadFeastAppCtaWithIcon';
import { Heading } from '../../shared/Heading';
import type {
CancellationContextInterface,
Expand Down Expand Up @@ -324,7 +324,7 @@ export const CancelAlternativeConfirmed = () => {
</div>
</div>
<DownloadAppCta additionalCss={appAdCss} />
<DownloadFeastAppCta additionalCss={appAdCss} />
<DownloadFeastAppCtaWithIcon additionalCss={appAdCss} />
<div css={dontForgetCss}>
<SvgInfoRound
size="small"
Expand Down
11 changes: 11 additions & 0 deletions client/components/mma/shared/DownloadAppCtaVariation1.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Meta, StoryFn } from '@storybook/react';
import { DownloadAppCtaVariation1 } from './DownloadAppCtaVariation1';

export default {
title: 'Components/DownloadAppCtaVariation1',
component: DownloadAppCtaVariation1,
} as Meta<typeof DownloadAppCtaVariation1>;

export const Default: StoryFn<typeof DownloadAppCtaVariation1> = () => (
<DownloadAppCtaVariation1 />
);
124 changes: 124 additions & 0 deletions client/components/mma/shared/DownloadAppCtaVariation1.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import {
from,
space,
textSans15,
textSans17,
textSansBold17,
textSansBold20,
until,
} from '@guardian/source/foundations';
import { androidAppUrl, iosAppUrl } from '@/shared/externalLinks';
import { AndroidPlayStoreButton } from './assets/AndroidPlayStoreButton';
import { AppleAppStoreButton } from './assets/AppleAppStoreButton';

interface DownloadAppCtaVariation1Props {
additionalCss?: SerializedStyles;
}

const containerCss = css`
background-color: #e1eaf7;
h4 {
${textSansBold17};
margin: 0 ${space[5]}px 0 0;
}
p {
${textSans15};
margin: ${space[1]}px ${space[5]}px 0 0;
}
${from.tablet} {
padding: ${space[6]}px 0 0 ${space[6]}px;
h4 {
${textSansBold20};
}
p {
${textSans17};
}
}
`;

const inlineContentsCss = css`
display: flex;
flex-direction: column;
column-gap: ${space[3]}px;
${from.tablet} {
flex-direction: row;
}
`;

const copyContainerCss = css`
order: 2;
margin-top: ${space[4]}px;
padding: 0 ${space[3]}px ${space[5]}px;
${from.tablet} {
order: 1;
margin: 0 0 ${space[6]}px;
padding: 0;
}
`;

const appStoreBtnsContainerCss = css`
margin-top: ${space[4]}px;
`;

const heroImageContainerCss = css`
align-items: flex-end;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.1));
display: flex;
flex-grow: 1;
order: 1;
${from.tablet} {
background: none;
order: 2;
}
`;

const heroImageCss = css`
margin: 0 auto;
max-width: 450px;
${until.tablet} {
width: 100%;
}
${from.tablet} {
max-width: 340px;
}
`;

export const DownloadAppCtaVariation1 = (
props: DownloadAppCtaVariation1Props,
) => {
return (
<div css={[containerCss, props.additionalCss]}>
<div css={inlineContentsCss}>
<div css={copyContainerCss}>
<h4>The Guardian News app</h4>
<p>
Never miss a story with unlimited access to our quality
news app, plus enjoy personalised recommendations and
offline reading.
</p>
<div css={appStoreBtnsContainerCss}>
<AppleAppStoreButton
link={iosAppUrl}
overrideButtonHeight="36px"
additionalCss={css`
margin-right: ${space[3]}px;
`}
/>
<AndroidPlayStoreButton
link={androidAppUrl}
overrideButtonHeight="36px"
/>
</div>
</div>
<div css={heroImageContainerCss}>
<img
css={heroImageCss}
src="https://i.guim.co.uk/img/media/b78dc3cead7cdb7c2b31367a156ae34335239757/0_0_5440_2960/1000.png?width=1000&quality=75&s=74b7b2b58c094ef7534bb3e08a8e848c"
/>
</div>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AndroidPlayStoreButton } from './assets/AndroidPlayStoreButton';
import { AppleAppStoreButton } from './assets/AppleAppStoreButton';
import { FeastAppIcon } from './assets/FeastAppIcon';

interface DownloadFeastAppCtaProps {
interface DownloadFeastAppCtaWithIconProps {
additionalCss?: SerializedStyles;
}

Expand Down Expand Up @@ -45,7 +45,9 @@ const appIconContainerCss = css`
}
`;

export const DownloadFeastAppCta = (props: DownloadFeastAppCtaProps) => {
export const DownloadFeastAppCtaWithIcon = (
props: DownloadFeastAppCtaWithIconProps,
) => {
return (
<div css={[appAdCss, props.additionalCss]}>
<div css={inlineContentsCss}>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Meta, StoryFn } from '@storybook/react';
import { DownloadFeastAppCtaWithImage } from './DownloadFeastAppCtaWithImage';

export default {
title: 'Components/DownloadFeastAppCtaWithImage',
component: DownloadFeastAppCtaWithImage,
} as Meta<typeof DownloadFeastAppCtaWithImage>;

export const Default: StoryFn<typeof DownloadFeastAppCtaWithImage> = () => (
<DownloadFeastAppCtaWithImage />
);
123 changes: 123 additions & 0 deletions client/components/mma/shared/DownloadFeastAppCtaWithImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import {
from,
space,
textSans15,
textSans17,
textSansBold17,
textSansBold20,
until,
} from '@guardian/source/foundations';
import { androidFeastAppUrl, iosFeastAppUrl } from '@/shared/externalLinks';
import { AndroidPlayStoreButton } from './assets/AndroidPlayStoreButton';
import { AppleAppStoreButton } from './assets/AppleAppStoreButton';

interface DownloadFeastAppCtaWithImageProps {
additionalCss?: SerializedStyles;
}

const containerCss = css`
background-color: #e1e5d5;
h4 {
${textSansBold17};
margin: 0 ${space[5]}px 0 0;
}
p {
${textSans15};
margin: ${space[1]}px ${space[5]}px 0 0;
}
${from.tablet} {
padding: ${space[6]}px 0 0 ${space[6]}px;
h4 {
${textSansBold20};
}
p {
${textSans17};
}
}
`;

const inlineContentsCss = css`
display: flex;
flex-direction: column;
column-gap: ${space[3]}px;
${from.tablet} {
flex-direction: row;
}
`;

const copyContainerCss = css`
order: 2;
margin-top: ${space[4]}px;
padding: 0 ${space[3]}px ${space[5]}px;
${from.tablet} {
order: 1;
margin: 0 0 ${space[6]}px;
padding: 0;
}
`;

const appStoreBtnsContainerCss = css`
margin-top: ${space[4]}px;
`;

const heroImageContainerCss = css`
align-items: flex-end;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.1));
display: flex;
flex-grow: 1;
order: 1;
${from.tablet} {
background: none;
order: 2;
}
`;

const heroImageCss = css`
margin: 0 auto;
max-width: 450px;
${until.tablet} {
width: 100%;
}
${from.tablet} {
max-width: 340px;
}
`;

export const DownloadFeastAppCtaWithImage = (
props: DownloadFeastAppCtaWithImageProps,
) => {
return (
<div css={[containerCss, props.additionalCss]}>
<div css={inlineContentsCss}>
<div css={copyContainerCss}>
<h4>The Guardian Feast app</h4>
<p>
Discover thousands of recipes from the Guardian and
Observer in our ultimate cooking companion app.
</p>
<div css={appStoreBtnsContainerCss}>
<AppleAppStoreButton
link={iosFeastAppUrl}
overrideButtonHeight="36px"
additionalCss={css`
margin-right: ${space[3]}px;
`}
/>
<AndroidPlayStoreButton
link={androidFeastAppUrl}
overrideButtonHeight="36px"
/>
</div>
</div>
<div css={heroImageContainerCss}>
<img
css={heroImageCss}
src="https://i.guim.co.uk/img/media/acaeaf4cf9d5c51317be78a8927613ac6eb927cb/0_0_1360_740/1000.png?width=1000&quality=75&s=75ce87c89bcc216ed535833347064985"
/>
</div>
</div>
</div>
);
};
11 changes: 11 additions & 0 deletions client/components/mma/shared/NewspaperArchiveCta.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Meta, StoryFn } from '@storybook/react';
import { NewspaperArchiveCta } from './NewspaperArchiveCta';

export default {
title: 'Components/NewpaperArchiveCta',
component: NewspaperArchiveCta,
} as Meta<typeof NewspaperArchiveCta>;

export const Default: StoryFn<typeof NewspaperArchiveCta> = () => (
<NewspaperArchiveCta />
);
Loading
Loading