diff --git a/projects/plugins/jetpack/changelog/change-jetpack-ai-logo-generator-block-toolbar-button b/projects/plugins/jetpack/changelog/change-jetpack-ai-logo-generator-block-toolbar-button new file mode 100644 index 0000000000000..2412d7512243d --- /dev/null +++ b/projects/plugins/jetpack/changelog/change-jetpack-ai-logo-generator-block-toolbar-button @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Jetpack AI: show button label on logo block toolbar if site's logo is empty diff --git a/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/components/ai-toolbar-button.tsx b/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/components/ai-toolbar-button.tsx index 5dc1793f065d6..7e51b28339524 100644 --- a/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/components/ai-toolbar-button.tsx +++ b/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/components/ai-toolbar-button.tsx @@ -13,19 +13,24 @@ import type { ReactElement } from 'react'; /** * The toolbar button that toggles the Logo Generator Modal. * - * @param {object} props - The component props. - * @param {Function} props.clickHandler - The handler for the click event. + * @param {object} props - The component props. + * @param {Function} props.clickHandler - The handler for the click event. + * @param {boolean} props.showButtonText - Use text for the button face or not. * @return {ReactElement} The toolbar button. */ export default function AiToolbarButton( { clickHandler, + showButtonText = false, }: { clickHandler?: () => void; + showButtonText?: boolean; } ): ReactElement { const toggleFromToolbar = useCallback( () => { clickHandler?.(); }, [ clickHandler ] ); + const text = showButtonText ? __( 'Generate', 'jetpack' ) : ''; + return ( <> + > + { text } + ); } diff --git a/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/index.tsx b/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/index.tsx index 6d87f4116ecf8..6fb31d290f74c 100644 --- a/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/index.tsx +++ b/projects/plugins/jetpack/extensions/extended-blocks/core-site-logo/index.tsx @@ -26,6 +26,7 @@ type CoreSelect = { url: string; title: string; description: string; + site_logo: number; }; }; @@ -80,6 +81,7 @@ const useSiteDetails = () => { domain: window?.Jetpack_Editor_Initial_State?.siteFragment, name: siteSettings?.title, description: siteSettings?.description, + siteLogo: siteSettings?.site_logo || 0, }; }; @@ -129,7 +131,7 @@ const siteLogoEditWithAiComponents = createHigherOrderComponent( BlockEdit => { <> - +