From 6806f61aa7b2525463ab32d9a1a4d62cf1289df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alba=20Rinc=C3=B3n?= Date: Wed, 29 Nov 2023 15:00:40 +0100 Subject: [PATCH 1/2] Show the survey button only when AI is available --- .../client/customize-store/assembler-hub/layout.tsx | 1 + .../client/customize-store/transitional/index.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/layout.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/layout.tsx index e4c23bc4aa2..4babcce2616 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/layout.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/layout.tsx @@ -96,6 +96,7 @@ export const Layout = () => { hasCompleteSurvey={ !! context?.transitionalScreen?.hasCompleteSurvey } + aiOnline={ !! context?.aiOnline } /> diff --git a/plugins/woocommerce-admin/client/customize-store/transitional/index.tsx b/plugins/woocommerce-admin/client/customize-store/transitional/index.tsx index 19c34cc069c..27b687c0181 100644 --- a/plugins/woocommerce-admin/client/customize-store/transitional/index.tsx +++ b/plugins/woocommerce-admin/client/customize-store/transitional/index.tsx @@ -39,12 +39,14 @@ export const Transitional = ( { hasCompleteSurvey, isSurveyOpen, setSurveyOpen, + aiOnline, }: { editor: React.ReactNode; sendEvent: ( event: events ) => void; hasCompleteSurvey: boolean; isSurveyOpen: boolean; setSurveyOpen: ( isOpen: boolean ) => void; + aiOnline: boolean; } ) => { const homeUrl: string = getSetting( 'homeUrl', '' ); const isEditorLoading = useIsSiteEditorLoading(); @@ -54,7 +56,7 @@ export const Transitional = ( { return (
- { isSurveyOpen && ( + { isSurveyOpen && aiOnline && ( closeSurvey() } @@ -95,7 +97,7 @@ export const Transitional = ( {
- { ! hasCompleteSurvey && ( + { ! hasCompleteSurvey && aiOnline && (