@@ -5,6 +5,7 @@ import { EmailSignup } from './EmailSignup';
55import { InlineSkipToWrapper } from './InlineSkipToWrapper' ;
66import { Island } from './Island' ;
77import { NewsletterPrivacyMessage } from './NewsletterPrivacyMessage' ;
8+ import { NewsletterSignupCardContainer } from './NewsletterSignupCardContainer' ;
89import { Placeholder } from './Placeholder' ;
910import { SecureSignup } from './SecureSignup.island' ;
1011
@@ -22,11 +23,15 @@ interface EmailSignUpWrapperProps extends EmailSignUpProps {
2223 listId : number ;
2324 identityName : string ;
2425 successDescription : string ;
26+ /** Illustration image URL (square crop) for the NewsletterSignupCard variant */
27+ illustrationSquare ?: string ;
2528 idApiUrl : string ;
2629 /** You should only set this to true if the privacy message will be shown elsewhere on the page */
2730 hidePrivacyMessage ?: boolean ;
2831 /** Feature flag to enable hiding newsletter signup for already subscribed users */
2932 hideNewsletterSignupComponentForSubscribers ?: boolean ;
33+ /** Feature flag to show the new NewsletterSignupCard design instead of EmailSignup */
34+ showNewNewsletterSignupCard ?: boolean ;
3035}
3136
3237/**
@@ -44,14 +49,47 @@ export const EmailSignUpWrapper = ({
4449 listId,
4550 idApiUrl,
4651 hideNewsletterSignupComponentForSubscribers = false ,
52+ showNewNewsletterSignupCard = false ,
4753 ...emailSignUpProps
4854} : EmailSignUpWrapperProps ) => {
55+ const shouldCheckSubscription =
56+ hideNewsletterSignupComponentForSubscribers &&
57+ ! showNewNewsletterSignupCard ;
4958 const isSubscribed = useNewsletterSubscription (
5059 listId ,
5160 idApiUrl ,
52- hideNewsletterSignupComponentForSubscribers ,
61+ shouldCheckSubscription ,
5362 ) ;
5463
64+ // When the new card design is enabled, always show it regardless of subscription status
65+ if ( showNewNewsletterSignupCard ) {
66+ return (
67+ < InlineSkipToWrapper
68+ id = { `EmailSignup-skip-link-${ index } ` }
69+ blockDescription = "newsletter promotion"
70+ >
71+ < NewsletterSignupCardContainer
72+ name = { emailSignUpProps . name }
73+ frequency = { emailSignUpProps . frequency }
74+ description = { emailSignUpProps . description }
75+ illustrationSquare = { emailSignUpProps . illustrationSquare }
76+ >
77+ < Island priority = "feature" defer = { { until : 'visible' } } >
78+ < SecureSignup
79+ newsletterId = { emailSignUpProps . identityName }
80+ successDescription = {
81+ emailSignUpProps . successDescription
82+ }
83+ />
84+ </ Island >
85+ { ! emailSignUpProps . hidePrivacyMessage && (
86+ < NewsletterPrivacyMessage />
87+ ) }
88+ </ NewsletterSignupCardContainer >
89+ </ InlineSkipToWrapper >
90+ ) ;
91+ }
92+
5593 // Show placeholder while subscription status is being determined
5694 // This prevents layout shift in both subscribed and non-subscribed cases
5795 if ( isSubscribed === undefined ) {
0 commit comments