Skip to content

Commit 80cf0b3

Browse files
authored
AI Client: Fix Jetpack AI upgrade links on block editor (#44405)
* wrap the link texts * changelog * wrap remaining links * changelog
1 parent 136090b commit 80cf0b3

File tree

12 files changed

+27
-16
lines changed

12 files changed

+27
-16
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
AI Client: Fix Jetpack AI upgrade links on block editor

projects/js-packages/ai-client/src/components/message/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export function UpgradeMessage( {
209209
href={ upgradeUrl }
210210
target={ upgradeUrl ? '_blank' : null }
211211
>
212-
{ __( 'Upgrade now', 'jetpack-ai-client' ) }
212+
<span>{ __( 'Upgrade now', 'jetpack-ai-client' ) }</span>
213213
</Button>
214214
</Message>
215215
);
@@ -246,11 +246,11 @@ export function ErrorMessage( {
246246
href={ upgradeUrl }
247247
target={ upgradeUrl ? '_blank' : null }
248248
>
249-
{ __( 'Upgrade now', 'jetpack-ai-client' ) }
249+
<span>{ __( 'Upgrade now', 'jetpack-ai-client' ) }</span>
250250
</Button>
251251
) : (
252252
<Button variant="link" onClick={ onTryAgainClick }>
253-
{ __( 'Try again', 'jetpack-ai-client' ) }
253+
<span>{ __( 'Try again', 'jetpack-ai-client' ) }</span>
254254
</Button>
255255
) }
256256
</Message>

projects/js-packages/ai-client/src/components/quota-exceeded-message/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const useFairUsageNoticeMessage = () => {
4747

4848
const getFairUsageNoticeMessage = resetDateString => {
4949
const fairUsageMessage = __(
50-
"You've reached this month's request limit, per our <link>fair usage policy</link>.",
50+
"You've reached this month's request limit, per our <link><span>fair usage policy</span></link>.",
5151
'jetpack-ai-client'
5252
);
5353

@@ -75,6 +75,7 @@ const useFairUsageNoticeMessage = () => {
7575
rel="noreferrer"
7676
/>
7777
),
78+
span: <span />,
7879
} );
7980

8081
return fairUsageNoticeMessageElement;

projects/js-packages/ai-client/src/components/quota-exceeded-message/light-nudge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const LightNudge = ( {
2828
variant="link"
2929
target={ target }
3030
>
31-
{ isRedirecting ? redirectingText : buttonText }
31+
<span>{ isRedirecting ? redirectingText : buttonText }</span>
3232
</Button>
3333
) }
3434
</p>

projects/js-packages/ai-client/src/logo-generator/components/prompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export const Prompt = ( { initialPrompt = '' }: PromptProps ) => {
307307
target="_blank"
308308
onClick={ onUpgradeClick }
309309
>
310-
{ __( 'Upgrade', 'jetpack-ai-client' ) }
310+
<span>{ __( 'Upgrade', 'jetpack-ai-client' ) }</span>
311311
</Button>
312312
</>
313313
) }

projects/js-packages/ai-client/src/logo-generator/components/upgrade-nudge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const UpgradeNudge = () => {
5050
className="is-primary"
5151
onClick={ handleUpgradeClick }
5252
>
53-
{ buttonText }
53+
<span>{ buttonText }</span>
5454
</Button>
5555
</div>
5656
</div>

projects/js-packages/ai-client/src/logo-generator/components/upgrade-screen.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ export const UpgradeScreen: FC< {
5252
</span>
5353
&nbsp;
5454
<Button variant="link" href={ upgradeInfoUrl } target="_blank">
55-
{ __( 'Learn more about Jetpack AI.', 'jetpack-ai-client' ) }
55+
<span>{ __( 'Learn more about Jetpack AI.', 'jetpack-ai-client' ) }</span>
5656
</Button>
5757
</div>
5858
<div className="jetpack-ai-logo-generator-modal__notice-actions">
5959
<Button variant="tertiary" onClick={ onCancel }>
60-
{ __( 'Cancel', 'jetpack-ai-client' ) }
60+
<span>{ __( 'Cancel', 'jetpack-ai-client' ) }</span>
6161
</Button>
6262
<Button
6363
variant="primary"
6464
href={ upgradeURL }
6565
target="_blank"
6666
onClick={ handleUpgradeClick }
6767
>
68-
{ __( 'Upgrade', 'jetpack-ai-client' ) }
68+
<span>{ __( 'Upgrade', 'jetpack-ai-client' ) }</span>
6969
</Button>
7070
</div>
7171
</div>

projects/js-packages/ai-client/src/logo-generator/components/visit-site-banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const VisitSiteBanner: FC< {
4444
target="_blank"
4545
onClick={ onVisitBlankTarget ? onVisitBlankTarget : null }
4646
>
47-
{ __( 'Learn more about Jetpack AI', 'jetpack-ai-client' ) }
47+
<span>{ __( 'Learn more about Jetpack AI', 'jetpack-ai-client' ) }</span>
4848
<Icon icon={ external } size={ 20 } />
4949
</Button>
5050
</div>

projects/js-packages/ai-client/src/logo-generator/hooks/use-fair-usage-notice-message.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const useFairUsageNoticeMessage = (): Element => {
3333

3434
const getFairUsageNoticeMessage = resetDateString => {
3535
const fairUsageMessage = __(
36-
"You've reached this month's request limit, per our <link>fair usage policy</link>.",
36+
"You've reached this month's request limit, per our <link><span>fair usage policy</span></link>.",
3737
'jetpack-ai-client'
3838
);
3939

@@ -59,6 +59,7 @@ const useFairUsageNoticeMessage = (): Element => {
5959

6060
const fairUsageNoticeMessageElement = createInterpolateElement( fairUsageNoticeMessage, {
6161
link: <a href={ upgradeInfoUrl } target="_blank" rel="noreferrer" />,
62+
span: <span />,
6263
} );
6364

6465
return fairUsageNoticeMessageElement;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: other
3+
4+
AI Assistant: Fix Jetpack AI links on block editor

0 commit comments

Comments
 (0)