[CYS on Core] Ensure the "Didn’t find a theme you like" text is displayed exclusively at the bottom of the themes card (#45706)
* Ensure the 'Didn’t find a theme you like' text is displayed exclusively at the bottom of the themes card * Limit the display of the CYS design banner to the Themes screen. * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
2fc83cbe85
commit
61236dab0d
|
@ -1,14 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import {
|
import { Fragment, useEffect, useState } from '@wordpress/element';
|
||||||
createInterpolateElement,
|
|
||||||
Fragment,
|
|
||||||
useEffect,
|
|
||||||
useState,
|
|
||||||
} from '@wordpress/element';
|
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { __ } from '@wordpress/i18n';
|
|
||||||
import { addQueryArgs } from '@wordpress/url';
|
import { addQueryArgs } from '@wordpress/url';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,49 +114,26 @@ export default function ProductListContent( props: {
|
||||||
} ),
|
} ),
|
||||||
} }
|
} }
|
||||||
/>
|
/>
|
||||||
{ index === bannerPosition && (
|
{ index === bannerPosition &&
|
||||||
<NoAIBanner
|
props.type === 'theme' && (
|
||||||
redirectToCYSFlow={ () => {
|
<NoAIBanner
|
||||||
const customizeStoreDesignUrl =
|
redirectToCYSFlow={ () => {
|
||||||
addQueryArgs(
|
const customizeStoreDesignUrl =
|
||||||
`${ ADMIN_URL }admin.php`,
|
addQueryArgs(
|
||||||
{
|
`${ ADMIN_URL }admin.php`,
|
||||||
page: 'wc-admin',
|
{
|
||||||
path: '/customize-store/design',
|
page: 'wc-admin',
|
||||||
}
|
path: '/customize-store/design',
|
||||||
);
|
}
|
||||||
window.location.href =
|
);
|
||||||
customizeStoreDesignUrl;
|
window.location.href =
|
||||||
} }
|
customizeStoreDesignUrl;
|
||||||
/>
|
} }
|
||||||
) }
|
/>
|
||||||
|
) }
|
||||||
</Fragment>
|
</Fragment>
|
||||||
) ) }
|
) ) }
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
className={
|
|
||||||
'woocommerce-marketplace__browse-wp-theme-directory'
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<b>{ __( 'Didn’t find a theme you like?', 'woocommerce' ) }</b>
|
|
||||||
{ createInterpolateElement(
|
|
||||||
__(
|
|
||||||
' Browse the <a>WordPress.org theme directory</a> to discover more.',
|
|
||||||
'woocommerce'
|
|
||||||
),
|
|
||||||
{
|
|
||||||
a: (
|
|
||||||
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
||||||
<a
|
|
||||||
href={
|
|
||||||
ADMIN_URL +
|
|
||||||
'theme-install.php?search=e-commerce'
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
}
|
|
||||||
) }
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { __, _n, sprintf } from '@wordpress/i18n';
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
||||||
import { useContext, useState } from '@wordpress/element';
|
import {
|
||||||
|
createInterpolateElement,
|
||||||
|
useContext,
|
||||||
|
useState,
|
||||||
|
} from '@wordpress/element';
|
||||||
import { getNewPath, navigateTo, useQuery } from '@woocommerce/navigation';
|
import { getNewPath, navigateTo, useQuery } from '@woocommerce/navigation';
|
||||||
import { Button } from '@wordpress/components';
|
import { Button } from '@wordpress/components';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
@ -173,6 +177,34 @@ export default function Products( props: ProductsProps ) {
|
||||||
searchTerm={ props.searchTerm }
|
searchTerm={ props.searchTerm }
|
||||||
category={ category }
|
category={ category }
|
||||||
/>
|
/>
|
||||||
|
{ props.type === 'theme' && (
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
'woocommerce-marketplace__browse-wp-theme-directory'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<b>
|
||||||
|
{ __( 'Didn’t find a theme you like?', 'woocommerce' ) }
|
||||||
|
</b>
|
||||||
|
{ createInterpolateElement(
|
||||||
|
__(
|
||||||
|
' Browse the <a>WordPress.org theme directory</a> to discover more.',
|
||||||
|
'woocommerce'
|
||||||
|
),
|
||||||
|
{
|
||||||
|
a: (
|
||||||
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
||||||
|
<a
|
||||||
|
href={
|
||||||
|
ADMIN_URL +
|
||||||
|
'theme-install.php?search=e-commerce'
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}
|
||||||
|
) }
|
||||||
|
</div>
|
||||||
|
) }
|
||||||
{ showAllButton && (
|
{ showAllButton && (
|
||||||
<Button
|
<Button
|
||||||
className={ viewAllButonClassName }
|
className={ viewAllButonClassName }
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Ensure the "Didn’t find a theme you like" text and the "Design your own" banner are displayed exclusively at the bottom of the themes tab on WooCommerce > Extensions.
|
Loading…
Reference in New Issue