Skip to content

Commit aa078cb

Browse files
author
Juarez Mota
committed
feat: new sign in gate auxia v1
1 parent 12ec70d commit aa078cb

File tree

9 files changed

+180
-393
lines changed

9 files changed

+180
-393
lines changed

dotcom-rendering/fixtures/manual/sign-in-gate.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ export const mockAuxiaResponseDismissible = {
66
treatmentTrackingId: 'tracking-001',
77
surface: 'signin-gate',
88
treatmentContent: JSON.stringify({
9-
title: 'Register for free and continue reading',
10-
subtitle: "It's still free to read – this is not a paywall",
11-
body: "We're committed to keeping our quality reporting open. By registering and providing us with insight into your preferences, you're helping us to engage with you more deeply.",
12-
first_cta_name: 'Register for free',
9+
title: 'Like uninterrupted reading?\nSo do we. Sign in.',
10+
subtitle:
11+
"Sign in to keep reading. It's free, and we'll bring you right back here in under a minute.",
12+
body: '',
13+
first_cta_name: 'Create a free account',
1314
first_cta_link: 'https://profile.theguardian.com/register',
1415
second_cta_name: "I'll do it later",
1516
}),
@@ -25,10 +26,11 @@ export const mockAuxiaResponseNonDismissible = {
2526
treatmentTrackingId: 'tracking-002',
2627
surface: 'signin-gate',
2728
treatmentContent: JSON.stringify({
28-
title: 'Complete registration to continue reading',
29-
subtitle: 'Registration is required to access this content',
30-
body: 'To continue reading this article and access our quality journalism, please complete your registration.',
31-
first_cta_name: 'Complete registration',
29+
title: 'Like uninterrupted reading?\nSo do we. Sign in.',
30+
subtitle:
31+
"Sign in to keep reading. It's free, and we'll bring you right back here in under a minute.",
32+
body: '',
33+
first_cta_name: 'Create a free account',
3234
first_cta_link: 'https://profile.theguardian.com/register',
3335
second_cta_name: '', // Empty makes it non-dismissible
3436
}),
@@ -44,10 +46,10 @@ export const mockAuxiaResponseLegacy = {
4446
treatmentTrackingId: 'legacy-tracking',
4547
surface: 'signin-gate',
4648
treatmentContent: JSON.stringify({
47-
title: 'Register to continue reading',
49+
title: 'Like uninterrupted reading?\nSo do we. Sign in.',
4850
subtitle: '',
4951
body: '',
50-
first_cta_name: 'Register',
52+
first_cta_name: 'Create a free account',
5153
first_cta_link: 'https://profile.theguardian.com/register',
5254
second_cta_name: 'Not now',
5355
}),

dotcom-rendering/src/components/AuthProviderButtons/AuthProviderButtons.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { css } from '@emotion/react';
2-
import { from, remSpace } from '@guardian/source/foundations';
2+
import { from, palette, remSpace } from '@guardian/source/foundations';
33
import {
44
LinkButton,
55
SvgAppleBrand,
@@ -16,13 +16,15 @@ type AuthProviderButtonsProps = {
1616
queryParams: QueryParams;
1717
isNativeApp?: IsNativeApp;
1818
providers: AuthButtonProvider[];
19+
onClick?: (provider: AuthButtonProvider) => void;
1920
};
2021

2122
type AuthProviderButtonProps = {
2223
label: string;
2324
icon: React.ReactElement;
2425
socialProvider: string;
2526
queryParams: QueryParams;
27+
onClick?: (provider: AuthButtonProvider) => void;
2628
};
2729

2830
// The gap between elements in the main section of MinimalLayout.
@@ -54,17 +56,18 @@ const sharedButtonStyles = (width: ButtonWidth = 'full') => css`
5456

5557
export const secondaryButtonStyles = (width: ButtonWidth = 'full') => css`
5658
${sharedButtonStyles(width)}
57-
background-color: var(--color-button-secondary-background);
58-
border-color: var(--color-button-secondary-border);
59-
color: var(--color-button-secondary-text);
59+
background-color: ${palette.neutral[100]};
60+
border-color: ${palette.brand[400]};
61+
color: ${palette.brand[400]};
6062
&:hover {
61-
background-color: var(--color-button-secondary-background-hover);
63+
background-color: ${palette.neutral[93]};
6264
}
6365
`;
6466

6567
const appleIconOverrides = css`
6668
svg path {
67-
fill: var(--color-button-secondary-text) !important;
69+
/* stylelint-disable-next-line declaration-no-important */
70+
fill: ${palette.brand[400]} !important;
6871
}
6972
`;
7073

@@ -73,6 +76,7 @@ const SocialButton = ({
7376
icon,
7477
socialProvider,
7578
queryParams,
79+
onClick,
7680
}: AuthProviderButtonProps) => {
7781
return (
7882
<>
@@ -87,6 +91,7 @@ const SocialButton = ({
8791
},
8892
queryParams,
8993
)}
94+
onClick={() => onClick?.(socialProvider as AuthButtonProvider)}
9095
data-cy={`${socialProvider}-sign-in-button`}
9196
data-link-name={`${socialProvider}-social-button`}
9297
>
@@ -139,6 +144,7 @@ export const AuthProviderButtons = ({
139144
queryParams,
140145
isNativeApp,
141146
providers,
147+
onClick,
142148
}: AuthProviderButtonsProps) => {
143149
const buttonOrder = getButtonOrder(isNativeApp);
144150
return (
@@ -151,6 +157,7 @@ export const AuthProviderButtons = ({
151157
icon={socialButtonIcon(socialProvider)}
152158
socialProvider={socialProvider}
153159
queryParams={queryParams}
160+
onClick={onClick}
154161
/>
155162
))}
156163
{providers.includes('email') && (
@@ -163,6 +170,7 @@ export const AuthProviderButtons = ({
163170
{},
164171
queryParams,
165172
)}
173+
onClick={() => onClick?.('email')}
166174
>
167175
{authProviderButtonLabel('email')}
168176
</LinkButton>

0 commit comments

Comments
 (0)