From b7ada2608795f7cbd756acded3a7ea7703d56c2b Mon Sep 17 00:00:00 2001 From: Vara Date: Thu, 25 Jan 2024 08:18:03 +0530 Subject: [PATCH 1/2] fix issue with onboarding in AI branch --- src/OnboardingSPA/components/Button/index.js | 8 +-- .../HeadingWithSubHeading/SiteGen/index.js | 3 +- .../SiteGenPreviewSelectableCard/index.js | 16 ++++-- .../SiteBuild/index.js | 51 +++++++++++-------- .../NewfoldInterfaceSkeleton/index.js | 15 ++++-- 5 files changed, 56 insertions(+), 37 deletions(-) diff --git a/src/OnboardingSPA/components/Button/index.js b/src/OnboardingSPA/components/Button/index.js index a5efeaee4..52d5502d7 100644 --- a/src/OnboardingSPA/components/Button/index.js +++ b/src/OnboardingSPA/components/Button/index.js @@ -5,10 +5,10 @@ * @return Button */ -const Button = ( { children, onClick, disabled, className } ) => { +const Button = ( { text, handleClick, disabled, className } ) => { const handleBtnClick = () => { - if ( onClick ) { - onClick(); + if ( handleClick ) { + handleClick(); } }; @@ -19,7 +19,7 @@ const Button = ( { children, onClick, disabled, className } ) => { onClick={ handleBtnClick } disabled={ disabled } > - { children } + { text } ); }; diff --git a/src/OnboardingSPA/components/HeadingWithSubHeading/SiteGen/index.js b/src/OnboardingSPA/components/HeadingWithSubHeading/SiteGen/index.js index e0973c695..a9d22011f 100644 --- a/src/OnboardingSPA/components/HeadingWithSubHeading/SiteGen/index.js +++ b/src/OnboardingSPA/components/HeadingWithSubHeading/SiteGen/index.js @@ -12,7 +12,8 @@ import { ThemeContext } from '../../ThemeContextProvider'; */ const HeadingWithSubHeading = ( { title, subtitle } ) => { - const { theme } = useContext( ThemeContext ); + const themeContext = useContext( ThemeContext ); + const theme = themeContext?.theme || false; return (
diff --git a/src/OnboardingSPA/components/LivePreview/SiteGenPreviewSelectableCard/index.js b/src/OnboardingSPA/components/LivePreview/SiteGenPreviewSelectableCard/index.js index e97c10b23..4ea6bd485 100644 --- a/src/OnboardingSPA/components/LivePreview/SiteGenPreviewSelectableCard/index.js +++ b/src/OnboardingSPA/components/LivePreview/SiteGenPreviewSelectableCard/index.js @@ -85,11 +85,17 @@ const SiteGenPreviewSelectableCard = ( { > + text={ + <> + + { __( + 'Preview Version', + 'wp-module-onboarding' + ) } + + } + handleClick={ handlePreview } + />
) }
{ isForkStep ); - return ( - - } - drawer={ } - content={ } - sidebar={ } - footer={ isForkStep ?