Change copy depending on the the AI availability

This commit is contained in:
Alba Rincón 2023-12-05 11:31:04 +01:00 committed by Luigi Teschio
parent 77826c6c76
commit cb3fdeb35d
1 changed files with 52 additions and 43 deletions

View File

@ -16,6 +16,7 @@ import { unlock } from '@wordpress/edit-site/build-module/lock-unlock';
/**
* Internal dependencies
*/
import { CustomizeStoreContext } from '../';
import { SidebarNavigationScreen } from './sidebar-navigation-screen';
import { ADMIN_URL } from '~/utils/admin-settings';
import { ColorPalette, ColorPanel } from './global-styles';
@ -54,15 +55,24 @@ const SidebarNavigationScreenColorPaletteContent = () => {
};
export const SidebarNavigationScreenColorPalette = () => {
const {
context: { aiOnline },
} = useContext( CustomizeStoreContext );
const description = aiOnline
? __(
'Based on the info you shared, our AI tool recommends using this color palette. Want to change it? You can select or add new colors below, or update them later in <EditorLink>Editor</EditorLink> | <StyleLink>Styles</StyleLink>.',
'woocommerce'
)
: __(
'Choose the color palette that best suits your brand. Want to change it? Create your custom color palette below, or update it later in <EditorLink>Editor</EditorLink> | <StyleLink>Styles</StyleLink>.',
'woocommerce'
);
return (
<SidebarNavigationScreen
title={ __( 'Change the color palette', 'woocommerce' ) }
description={ createInterpolateElement(
__(
'Based on the info you shared, our AI tool recommends using this color palette. Want to change it? You can select or add new colors below, or update them later in <EditorLink>Editor</EditorLink> | <StyleLink>Styles</StyleLink>.',
'woocommerce'
),
{
description={ createInterpolateElement( description, {
EditorLink: (
<Link
onClick={ () => {
@ -99,8 +109,7 @@ export const SidebarNavigationScreenColorPalette = () => {
href=""
/>
),
}
) }
} ) }
content={ <SidebarNavigationScreenColorPaletteContent /> }
/>
);