Skip to content

Commit 217ea26

Browse files
author
Juarez Mota
committed
feat: sign-in gate v2 dismissable
1 parent 9e85150 commit 217ea26

File tree

3 files changed

+312
-126
lines changed

3 files changed

+312
-126
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import React from 'react';
1515
import { buildUrlWithQueryParams } from '../../lib/routeUtils';
1616
import type { IsNativeApp, QueryParams } from './types';
17+
import { AuxiaGateVersion } from '../SignInGate/types';
1718

1819
type AuthButtonProvider = 'social' | 'email';
1920

@@ -22,6 +23,7 @@ type AuthProviderButtonsProps = {
2223
isNativeApp?: IsNativeApp;
2324
providers: AuthButtonProvider[];
2425
onClick?: (provider: AuthButtonProvider) => void;
26+
signInGateVersion?: AuxiaGateVersion;
2527
};
2628

2729
type AuthProviderButtonProps = {
@@ -35,13 +37,13 @@ type AuthProviderButtonProps = {
3537
// The gap between elements in the main section of MinimalLayout.
3638
export const SECTION_GAP = remSpace[3]; // 12px
3739

38-
export const mainSectionStyles = css`
40+
export const mainSectionStyles = (signInGateVersion: AuxiaGateVersion) => css`
3941
display: flex;
4042
flex-direction: column;
4143
gap: ${SECTION_GAP};
4244
4345
${from.phablet} {
44-
flex-direction: row;
46+
flex-direction: ${signInGateVersion === 'v1' ? 'row' : 'column'};
4547
}
4648
`;
4749

@@ -152,10 +154,11 @@ export const AuthProviderButtons = ({
152154
isNativeApp,
153155
providers,
154156
onClick,
157+
signInGateVersion = 'v1',
155158
}: AuthProviderButtonsProps) => {
156159
const buttonOrder = getButtonOrder(isNativeApp);
157160
return (
158-
<div css={mainSectionStyles}>
161+
<div css={mainSectionStyles(signInGateVersion)}>
159162
{providers.includes('social') &&
160163
buttonOrder.map((socialProvider) => (
161164
<SocialButton

dotcom-rendering/src/components/SignInGate/SignInGate.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ export const auxiaV2Modal = () => {
274274
treatmentTrackingId: 'test-tracking-id',
275275
surface: 'test-surface',
276276
treatmentContent: JSON.stringify({
277-
title: 'Sign in to continue reading',
278-
subtitle: 'Register for free and continue reading',
279-
body: 'Create your free Guardian account to access exclusive content and features.',
277+
title: 'A small step for great Journalism. Sign in.',
278+
subtitle: "It's free and only takes 30 seconds.",
279+
body: '',
280280
first_cta_name: 'Create account',
281281
first_cta_link: 'https://profile.theguardian.com/register',
282282
second_cta_name: 'Not now',
@@ -314,4 +314,4 @@ export const auxiaV2Modal = () => {
314314
);
315315
};
316316

317-
auxiaV2Modal.storyName = 'auxia_v2_modal';
317+
auxiaV2Modal.storyName = 'sign_in_gate_auxia_v2_modal_dismissable';

0 commit comments

Comments
 (0)