diff --git a/src/OnboardingSPA/components/TabPanelHover/index.js b/src/OnboardingSPA/components/TabPanelHover/index.js index c20b3377f..2c273a376 100644 --- a/src/OnboardingSPA/components/TabPanelHover/index.js +++ b/src/OnboardingSPA/components/TabPanelHover/index.js @@ -45,6 +45,7 @@ const TabButton = ( { ); }; +/* the default will be mouseover and will be click event if triggerEvent="click" is specifically passed */ const useEventTrigger = ( triggerEvent, handleEvent, tabName ) => { const eventHandler = useCallback( () => handleEvent( tabName ), @@ -66,7 +67,7 @@ export default function TabPanelHover( { notActiveClass = 'is-not-active', callback, onSelect = noop, - triggerEvent = 'click', + triggerEvent, } ) { const instanceId = useInstanceId( TabPanelHover, 'tab-panel' ); const [ selected, setSelected ] = useState( null ); diff --git a/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js b/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js index 82f9f72f0..996c77bcb 100644 --- a/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js +++ b/src/OnboardingSPA/steps/SiteGen/Editor/Header/index.js @@ -82,7 +82,7 @@ const StepSiteGenEditorHeader = () => { return; } - const { slug, color, isFavorite } = homepage || {}; + const { slug, title, color, isFavorite } = homepage || {}; const response = await regenerateHomepage( currentData.sitegen.siteDetails.prompt, slug, @@ -96,6 +96,14 @@ const StepSiteGenEditorHeader = () => { } const regeneratedHomepage = response.body; + /* The below condition is a temp work-around as during the rename the homepage title is not saved the options table directly, + but is update in the local state only, so to display the Title of the newly regeneated page we assign the newly renamed title */ + if ( isFavorite ) { + const renamedTitleWithSuffix = `${ title } (Copy)`; + if ( renamedTitleWithSuffix !== regeneratedHomepage?.title ) { + regeneratedHomepage.title = renamedTitleWithSuffix; + } + } homepages[ regeneratedHomepage.slug ] = regeneratedHomepage; currentData.sitegen.homepages.data = homepages; currentData.sitegen.homepages.active = regeneratedHomepage;