Skip to content

Commit 88c28f1

Browse files
authored
Close the help center when clicking the Big Sky add site card (#103937)
* Close the help center when clicking the Big Sky add site card * restore actual link
1 parent 6085912 commit 88c28f1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

client/dashboard/sites/add-new-site/index.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Button,
99
} from '@wordpress/components';
1010
import { useViewportMatch } from '@wordpress/compose';
11+
import { useDispatch } from '@wordpress/data';
1112
import { __, sprintf } from '@wordpress/i18n';
1213
import { download, reusableBlock, Icon } from '@wordpress/icons';
1314
import devSiteBanner from 'calypso/assets/images/a8c-for-agencies/dev-site-banner.svg';
@@ -44,11 +45,6 @@ const offerClick = () => {
4445
action: 'offer',
4546
} );
4647
};
47-
const bigSkyClick = () => {
48-
recordTracksEvent( 'calypso_sites_dashboard_new_site_action_click_item', {
49-
action: 'big-sky',
50-
} );
51-
};
5248

5349
function AddNewSite( { context }: AddNewSiteProps ) {
5450
const isDesktop = useViewportMatch( 'medium' );
@@ -60,6 +56,7 @@ function AddNewSite( { context }: AddNewSiteProps ) {
6056
numberFormatOptions: { style: 'percent' },
6157
} )
6258
);
59+
const { setShowHelpCenter } = useDispatch( 'automattic/help-center' );
6360

6461
return (
6562
<Wrapper alignment="flex-start" style={ { padding: '16px' } } spacing={ 6 }>
@@ -77,7 +74,12 @@ function AddNewSite( { context }: AddNewSiteProps ) {
7774
description={ __(
7875
'Prompt, edit, and launch WordPress websites with Artificial Intelligence.'
7976
) }
80-
onClick={ bigSkyClick }
77+
onClick={ () => {
78+
setShowHelpCenter( false ); // Close the help center
79+
recordTracksEvent( 'calypso_sites_dashboard_new_site_action_click_item', {
80+
action: 'big-sky',
81+
} );
82+
} }
8183
href={ `/setup/ai-site-builder?source=${ context }&ref=new-site-popover` }
8284
/>
8385
<MenuItem

0 commit comments

Comments
 (0)