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 on Core] Ensure the "Didn’t find a theme you like" text is displayed exclusively at the bottom of the themes card #45706

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
/**
* External dependencies
*/
import {
createInterpolateElement,
Fragment,
useEffect,
useState,
} from '@wordpress/element';
import { Fragment, useEffect, useState } from '@wordpress/element';
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { addQueryArgs } from '@wordpress/url';

/**
Expand Down Expand Up @@ -120,49 +114,26 @@ export default function ProductListContent( props: {
} ),
} }
/>
{ index === bannerPosition && (
<NoAIBanner
redirectToCYSFlow={ () => {
const customizeStoreDesignUrl =
addQueryArgs(
`${ ADMIN_URL }admin.php`,
{
page: 'wc-admin',
path: '/customize-store/design',
}
);
window.location.href =
customizeStoreDesignUrl;
} }
/>
) }
{ index === bannerPosition &&
props.type === 'theme' && (
<NoAIBanner
redirectToCYSFlow={ () => {
const customizeStoreDesignUrl =
addQueryArgs(
`${ ADMIN_URL }admin.php`,
{
page: 'wc-admin',
path: '/customize-store/design',
}
);
window.location.href =
customizeStoreDesignUrl;
} }
/>
) }
</Fragment>
) ) }
</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>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
* External dependencies
*/
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 { Button } from '@wordpress/components';
import classnames from 'classnames';
Expand Down Expand Up @@ -173,6 +177,34 @@ export default function Products( props: ProductsProps ) {
searchTerm={ props.searchTerm }
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 && (
<Button
className={ viewAllButonClassName }
Expand Down