Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI Client: change logo generator upgrade message #39671

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

AI Client: change upgrade copy edit and redirect URL
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import getRedirectUrl from '../../../../components/tools/jp-redirect/index.js';
import { EVENT_PLACEMENT_FREE_USER_SCREEN, EVENT_UPGRADE } from '../constants.js';
import useLogoGenerator from '../hooks/use-logo-generator.js';
/**
Expand All @@ -21,8 +22,9 @@ export const UpgradeScreen: React.FC< {
} > = ( { onCancel, upgradeURL, reason } ) => {
const { tracks } = useAnalytics();
const { recordEvent: recordTracksEvent } = tracks;

const upgradeMessageFeature = __(
'The logo generator requires a paid Jetpack AI plan. Upgrade your plan to access exclusive features, including logo generation. The upgrade will also increase the amount of requests you can use in all AI-powered features.',
'Upgrade your Jetpack AI for access to logo generation. This upgrade will also increase the amount of monthly requests you can use in for all AI-powered features.',
'jetpack-ai-client'
);

Expand All @@ -31,6 +33,10 @@ export const UpgradeScreen: React.FC< {
'jetpack-ai-client'
);

const upgradeInfoUrl = getRedirectUrl( 'ai-logo-generator-fair-usage-policy', {
anchor: 'usage-limitations-and-upgrades',
} );

const { context } = useLogoGenerator();

const handleUpgradeClick = () => {
Expand All @@ -45,7 +51,7 @@ export const UpgradeScreen: React.FC< {
{ reason === 'feature' ? upgradeMessageFeature : upgradeMessageRequests }
</span>
&nbsp;
<Button variant="link" href="https://jetpack.com/ai/" target="_blank">
<Button variant="link" href={ upgradeInfoUrl } target="_blank">
{ __( 'Learn more about Jetpack AI.', 'jetpack-ai-client' ) }
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useSelect } from '@wordpress/data';
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import getRedirectUrl from '../../../../components/tools/jp-redirect/index.js';
/**
* Internal dependencies
*/
Expand Down Expand Up @@ -52,14 +53,12 @@ const useFairUsageNoticeMessage = () => {
// Get the proper template based on the presence of the next usage period start date.
const fairUsageNoticeMessage = getFairUsageNoticeMessage( nextUsagePeriodStartDateString );

const upgradeInfoUrl = getRedirectUrl( 'ai-logo-generator-fair-usage-policy', {
anchor: 'jetpack-ai-usage-limit',
} );

const fairUsageNoticeMessageElement = createInterpolateElement( fairUsageNoticeMessage, {
link: (
<a
href="https://jetpack.com/redirect/?source=ai-logo-generator-fair-usage-policy"
target="_blank"
rel="noreferrer"
/>
),
link: <a href={ upgradeInfoUrl } target="_blank" rel="noreferrer" />,
} );

return fairUsageNoticeMessageElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Components - getRedirectUrl: use file extension on import for linter to find definitions
2 changes: 1 addition & 1 deletion projects/js-packages/components/tools/jp-redirect/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global jetpack_redirects */

import { GetRedirectUrlArgs, QueryVars } from './types';
import { GetRedirectUrlArgs, QueryVars } from './types.js';

/**
* Builds an URL using the jetpack.com/redirect/ service
Expand Down
Loading