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

[CYS] Update footer and homepage copy #44800

Merged
merged 14 commits into from Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -60,20 +60,24 @@ export const SidebarNavigationScreenColorPalette = () => {
context: { flowType },
} = useContext( CustomizeStoreContext );

const description =
flowType === FlowType.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'
);
const aiOnline = flowType === FlowType.AIOnline;

const title = aiOnline
? __( 'Change the color palette', 'woocommerce' )
: __( 'Choose your color palette', 'woocommerce' );
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' ) }
title={ title }
description={ createInterpolateElement( description, {
EditorLink: (
<Link
Expand Down
Expand Up @@ -27,6 +27,8 @@ import { useEditorScroll } from '../hooks/use-editor-scroll';
import { useSelectedPattern } from '../hooks/use-selected-pattern';
import { findPatternByBlock } from './utils';
import BlockPatternList from '../block-pattern-list';
import { CustomizeStoreContext } from '~/customize-store/assembler-hub';
import { FlowType } from '~/customize-store/types';

const SUPPORTED_FOOTER_PATTERNS = [
'woocommerce-blocks/footer-simple-menu',
Expand Down Expand Up @@ -93,36 +95,47 @@ export const SidebarNavigationScreenFooter = () => {
[ blocks, onChange, setSelectedPattern, scroll ]
);

const { context } = useContext( CustomizeStoreContext );
const aiOnline = context.flowType === FlowType.AIOnline;

const title = aiOnline
? __( 'Change your footer', 'woocommerce' )
: __( 'Choose your footer', 'woocommerce' );

const description = aiOnline
? __(
"Select a new footer from the options below. Your footer includes your site's secondary navigation and will be added to every page. You can continue customizing this via the <EditorLink>Editor</EditorLink>.",
'woocommerce'
)
: __(
"Select a footer from the options below. Your footer includes your site's secondary navigation and will be added to every page. You can continue customizing this via the <EditorLink>Editor</EditorLink> later.",
'woocommerce'
);

return (
<SidebarNavigationScreen
title={ __( 'Change your footer', 'woocommerce' ) }
title={ title }
onNavigateBackClick={ resetHighlightedBlockIndex }
description={ createInterpolateElement(
__(
"Select a new footer from the options below. Your footer includes your site's secondary navigation and will be added to every page. You can continue customizing this via the <EditorLink>Editor</EditorLink>.",
'woocommerce'
description={ createInterpolateElement( description, {
EditorLink: (
<Link
onClick={ () => {
recordEvent(
'customize_your_store_assembler_hub_editor_link_click',
{
source: 'footer',
}
);
window.open(
`${ ADMIN_URL }site-editor.php`,
'_blank'
);
return false;
} }
href=""
/>
),
{
EditorLink: (
<Link
onClick={ () => {
recordEvent(
'customize_your_store_assembler_hub_editor_link_click',
{
source: 'footer',
}
);
window.open(
`${ ADMIN_URL }site-editor.php`,
'_blank'
);
return false;
} }
href=""
/>
),
}
) }
} ) }
content={
<>
<div className="woocommerce-customize-store__sidebar-footer-content">
Expand Down
Expand Up @@ -27,6 +27,8 @@ import { HighlightedBlockContext } from '../context/highlighted-block-context';
import { useEditorScroll } from '../hooks/use-editor-scroll';
import { findPatternByBlock } from './utils';
import BlockPatternList from '../block-pattern-list';
import { CustomizeStoreContext } from '~/customize-store/assembler-hub';
import { FlowType } from '~/customize-store/types';

const SUPPORTED_HEADER_PATTERNS = [
'woocommerce-blocks/header-essential',
Expand Down Expand Up @@ -91,9 +93,16 @@ export const SidebarNavigationScreenHeader = () => {
[ blocks, onChange, setSelectedPattern, scroll ]
);

const { context } = useContext( CustomizeStoreContext );
const aiOnline = context.flowType === FlowType.AIOnline;

const title = aiOnline
? __( 'Change your header', 'woocommerce' )
: __( 'Choose your header', 'woocommerce' );

return (
<SidebarNavigationScreen
title={ __( 'Change your header', 'woocommerce' ) }
title={ title }
onNavigateBackClick={ resetHighlightedBlockIndex }
description={ createInterpolateElement(
__(
Expand Down
Expand Up @@ -96,20 +96,24 @@ export const SidebarNavigationScreenHomepage = () => {
}, [ blocks, homePatterns ] );

const { context } = useContext( CustomizeStoreContext );
const sidebarMessage =
context.flowType === FlowType.AIOnline
? __(
'Based on the most successful stores in your industry and location, our AI tool has recommended this template for your business. Prefer a different layout? Choose from the templates below now, or later via the <EditorLink>Editor</EditorLink>.',
'woocommerce'
)
: __(
'Based on the most successful stores, we recommend this layout for your business. Prefer something different? Choose from the templates below now, or continue customizing this page, including the content, later via the <EditorLink>Editor</EditorLink>.',
'woocommerce'
);
const aiOnline = context.flowType === FlowType.AIOnline;

const title = aiOnline
? __( 'Change your homepage', 'woocommerce' )
: __( 'Choose your homepage', 'woocommerce' );
const sidebarMessage = aiOnline
? __(
'Based on the most successful stores in your industry and location, our AI tool has recommended this template for your business. Prefer a different layout? Choose from the templates below now, or later via the <EditorLink>Editor</EditorLink>.',
'woocommerce'
)
: __(
'Create an engaging homepage by selecting one of our pre-designed layouts. You can continue customizing this page, including the content, later via the <EditorLink>Editor</EditorLink>.',
'woocommerce'
);

return (
<SidebarNavigationScreen
title={ __( 'Change your homepage', 'woocommerce' ) }
title={ title }
description={ createInterpolateElement( sidebarMessage, {
EditorLink: (
<Link
Expand Down
Expand Up @@ -3,7 +3,7 @@
*/
/* eslint-disable @woocommerce/dependency-group */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { createInterpolateElement } from '@wordpress/element';
import { createInterpolateElement, useContext } from '@wordpress/element';
import {
// @ts-ignore No types for this exist yet.
__experimentalItemGroup as ItemGroup,
Expand Down Expand Up @@ -31,8 +31,15 @@ import { recordEvent } from '@woocommerce/tracks';
*/
import { SidebarNavigationScreen } from './sidebar-navigation-screen';
import { ADMIN_URL } from '~/utils/admin-settings';
import { CustomizeStoreContext } from '~/customize-store/assembler-hub';
import { FlowType } from '~/customize-store/types';

export const SidebarNavigationScreenMain = () => {
const {
context: { flowType },
} = useContext( CustomizeStoreContext );
const aiOnline = flowType === FlowType.AIOnline;

return (
<SidebarNavigationScreen
isRoot
Expand Down Expand Up @@ -101,7 +108,15 @@ export const SidebarNavigationScreenMain = () => {
);
} }
>
{ __( 'Change the color palette', 'woocommerce' ) }
{ aiOnline
? __(
'Change the color palette',
'woocommerce'
)
: __(
'Choose your color palette',
'woocommerce'
) }
</NavigatorButton>
<NavigatorButton
as={ SidebarNavigationItem }
Expand All @@ -117,7 +132,9 @@ export const SidebarNavigationScreenMain = () => {
);
} }
>
{ __( 'Change fonts', 'woocommerce' ) }
{ aiOnline
? __( 'Change fonts', 'woocommerce' )
: __( 'Choose fonts', 'woocommerce' ) }
</NavigatorButton>
</ItemGroup>
<div className="edit-site-sidebar-navigation-screen-patterns__group-header">
Expand All @@ -140,7 +157,9 @@ export const SidebarNavigationScreenMain = () => {
);
} }
>
{ __( 'Change your header', 'woocommerce' ) }
{ aiOnline
? __( 'Change your header', 'woocommerce' )
: __( 'Choose your header', 'woocommerce' ) }
</NavigatorButton>
<NavigatorButton
as={ SidebarNavigationItem }
Expand All @@ -156,7 +175,9 @@ export const SidebarNavigationScreenMain = () => {
);
} }
>
{ __( 'Change your homepage', 'woocommerce' ) }
{ aiOnline
? __( 'Change your homepage', 'woocommerce' )
: __( 'Design your homepage', 'woocommerce' ) }
</NavigatorButton>
<NavigatorButton
as={ SidebarNavigationItem }
Expand All @@ -172,7 +193,9 @@ export const SidebarNavigationScreenMain = () => {
);
} }
>
{ __( 'Change your footer', 'woocommerce' ) }
{ aiOnline
? __( 'Change your footer', 'woocommerce' )
: __( 'Choose your footer', 'woocommerce' ) }
</NavigatorButton>
{ /* TODO: Turn on this in Phrase 2 */ }
{ /* <NavigatorButton
Expand Down
Expand Up @@ -21,6 +21,9 @@ export const SidebarNavigationScreenTypography = () => {
const { context } = useContext( CustomizeStoreContext );
const aiOnline = context.flowType === FlowType.AIOnline;

const title = aiOnline
? __( 'Change your font', 'woocommerce' )
: __( 'Choose fonts', 'woocommerce' );
const label = aiOnline
? __(
"AI has selected a font pairing that's the best fit for your business. If you'd like to change them, select a new option below now, or later in <EditorLink>Editor</EditorLink> | <StyleLink>Styles</StyleLink>.",
Expand All @@ -33,7 +36,7 @@ export const SidebarNavigationScreenTypography = () => {

return (
<SidebarNavigationScreen
title={ __( 'Change your font', 'woocommerce' ) }
title={ title }
description={ createInterpolateElement( label, {
EditorLink: (
<Link
Expand Down
@@ -0,0 +1,4 @@
Significance: minor
Type: update

CYS - Update sidebar links copy on the assembled page.
@@ -0,0 +1,4 @@
Significance: minor
Type: update

CYS - Updates the footer and homepage sections of the assembler sidebar.
2 changes: 1 addition & 1 deletion plugins/woocommerce/patterns/footer-simple-menu.php
Expand Up @@ -31,7 +31,7 @@

<!-- wp:group {"style":{"spacing":{"blockGap":"5px"}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"center","orientation":"vertical"}} -->
<div class="wp-block-group">
<!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->
<!-- wp:site-title /-->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">
Expand Down
Expand Up @@ -101,7 +101,7 @@ test.describe( 'Store owner can view Assembler Hub for store customization', ()
page,
} ) => {
await page.goto( ASSEMBLER_HUB_URL );
await page.click( 'text=Change your header' );
await page.click( 'text=Choose your header' );

const locator = page.locator(
'.block-editor-block-patterns-list__list-item'
Expand Down