@@ -21,6 +21,20 @@ export const AiGenerateTitlesAndDescriptionsUpsell = ( { learnMoreLink, thumbnai
21
21
const upsellLinkWooPremiumBundle = useSelect ( select => select ( STORE ) . selectLink ( "https://yoa.st/ai-generator-upsell-woo-seo-premium-bundle" ) , [ ] ) ;
22
22
const upsellLinkWoo = useSelect ( select => select ( STORE ) . selectLink ( "https://yoa.st/ai-generator-upsell-woo-seo" ) , [ ] ) ;
23
23
let upsellLink = upsellLinkPremium ;
24
+ let newToText = sprintf (
25
+ /* translators: %1$s expands to Yoast SEO Premium. */
26
+ __ ( "New to %1$s" , "wordpress-seo" ) ,
27
+ "Yoast SEO Premium"
28
+ ) ;
29
+ const learnMoreLinkStructure = {
30
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
31
+ a : < OutboundLink
32
+ href = { learnMoreLink }
33
+ className = "yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium"
34
+ variant = "primary"
35
+ /> ,
36
+ ArrowNarrowRightIcon : < ArrowNarrowRightIcon className = "yst-w-4 yst-h-4 rtl:yst-rotate-180" /> ,
37
+ } ;
24
38
25
39
const isPremium = useSelect ( select => select ( STORE ) . getIsPremium ( ) , [ ] ) ;
26
40
const isWooSeoUpsell = useSelect ( select => select ( STORE ) . getIsWooSeoUpsell ( ) , [ ] ) ;
@@ -30,21 +44,29 @@ export const AiGenerateTitlesAndDescriptionsUpsell = ( { learnMoreLink, thumbnai
30
44
"Yoast SEO Premium"
31
45
) ;
32
46
let bundleNote = "" ;
47
+ let title = __ ( "Generate titles & descriptions with Yoast AI!" , "wordpress-seo" ) ;
33
48
34
49
if ( isWooSeoUpsell ) {
50
+ const upsellPremiumWooLabel = sprintf (
51
+ /* translators: %1$s expands to Yoast SEO Premium, %2$s expands to Yoast WooCommerce SEO. */
52
+ __ ( "%1$s + %2$s" , "wordpress-seo" ) ,
53
+ "Yoast SEO Premium" ,
54
+ "Yoast WooCommerce SEO"
55
+ ) ;
56
+ newToText = sprintf (
57
+ /* translators: %1$s expands to Yoast SEO Premium and Yoast WooCommerce SEO. */
58
+ __ ( "New to %1$s" , "wordpress-seo" ) ,
59
+ upsellPremiumWooLabel
60
+ ) ;
61
+ title = __ ( "Generate product titles & descriptions with AI!" , "wordpress-seo" ) ;
35
62
if ( ! isPremium ) {
36
63
upsellLabel = `${ sprintf (
37
64
/* translators: %1$s expands to Woo Premium bundle. */
38
65
__ ( "Unlock with the %1$s" , "wordpress-seo" ) ,
39
66
"Woo Premium bundle"
40
67
) } *`;
41
68
bundleNote = < div className = "yst-text-xs yst-text-slate-500 yst-mt-2" >
42
- { `*${ sprintf (
43
- /* translators: %1$s expands to Yoast SEO Premium, %2$s expands to Yoast WooCommerce SEO. */
44
- __ ( "%1$s + %2$s" , "wordpress-seo" ) ,
45
- "Yoast SEO Premium" ,
46
- "Yoast WooCommerce SEO"
47
- ) } ` }
69
+ { `*${ upsellPremiumWooLabel } ` }
48
70
</ div > ;
49
71
upsellLink = upsellLinkWooPremiumBundle ;
50
72
}
@@ -70,41 +92,42 @@ export const AiGenerateTitlesAndDescriptionsUpsell = ( { learnMoreLink, thumbnai
70
92
</ div >
71
93
< div className = "yst-mt-6 yst-text-xs yst-font-medium" >
72
94
< span className = "yst-introduction-modal-uppercase" >
73
- { sprintf (
74
- /* translators: %1$s expands to Yoast SEO Premium. */
75
- __ ( "New to %1$s" , "wordpress-seo" ) ,
76
- "Yoast SEO Premium"
77
- ) }
95
+ { newToText }
78
96
</ span >
79
97
80
98
< span className = "yst-uppercase yst-text-slate-700" > 21.0</ span >
81
99
</ div >
82
100
< div className = "yst-mt-4 yst-mx-1.5 yst-text-center" >
83
101
< h3 className = "yst-text-slate-900 yst-text-lg yst-font-medium" >
84
- { __ ( "Generate titles & descriptions with Yoast AI!" , "wordpress-seo" ) }
102
+ { title }
85
103
</ h3 >
86
104
< div className = "yst-mt-2 yst-text-slate-600 yst-text-sm" >
87
- { createInterpolateElement (
105
+ { isWooSeoUpsell ? createInterpolateElement (
88
106
sprintf (
89
107
/* translators: %1$s and %2$s are anchor tag; %3$s is the arrow icon. */
90
108
__ (
91
- "Speed up your workflow with generative AI. Get high-quality title and description suggestions for your search and social appearance. %1$sLearn more%2$s%3$s" ,
109
+ "Speed up your workflow with generative AI. Get high-quality product title and description suggestions for your search and social appearance. %1$sLearn more%2$s%3$s" ,
92
110
"wordpress-seo"
93
111
) ,
94
112
"<a>" ,
95
113
"<ArrowNarrowRightIcon />" ,
96
114
"</a>"
97
115
) ,
98
- {
99
- // eslint-disable-next-line jsx-a11y/anchor-has-content
100
- a : < OutboundLink
101
- href = { learnMoreLink }
102
- className = "yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium"
103
- variant = "primary"
104
- /> ,
105
- ArrowNarrowRightIcon : < ArrowNarrowRightIcon className = "yst-w-4 yst-h-4 rtl:yst-rotate-180" /> ,
106
- }
107
- ) }
116
+ learnMoreLinkStructure
117
+ )
118
+ : createInterpolateElement (
119
+ sprintf (
120
+ /* translators: %1$s and %2$s are anchor tag; %3$s is the arrow icon. */
121
+ __ (
122
+ "Speed up your workflow with generative AI. Get high-quality title and description suggestions for your search and social appearance. %1$sLearn more%2$s%3$s" ,
123
+ "wordpress-seo"
124
+ ) ,
125
+ "<a>" ,
126
+ "<ArrowNarrowRightIcon />" ,
127
+ "</a>"
128
+ ) ,
129
+ learnMoreLinkStructure
130
+ ) }
108
131
</ div >
109
132
</ div >
110
133
< div className = "yst-w-full yst-flex yst-mt-10" >
0 commit comments