8
8
Button ,
9
9
} from '@wordpress/components' ;
10
10
import { useViewportMatch } from '@wordpress/compose' ;
11
+ import { useDispatch } from '@wordpress/data' ;
11
12
import { __ , sprintf } from '@wordpress/i18n' ;
12
13
import { download , reusableBlock , Icon } from '@wordpress/icons' ;
13
14
import devSiteBanner from 'calypso/assets/images/a8c-for-agencies/dev-site-banner.svg' ;
@@ -44,11 +45,6 @@ const offerClick = () => {
44
45
action : 'offer' ,
45
46
} ) ;
46
47
} ;
47
- const bigSkyClick = ( ) => {
48
- recordTracksEvent ( 'calypso_sites_dashboard_new_site_action_click_item' , {
49
- action : 'big-sky' ,
50
- } ) ;
51
- } ;
52
48
53
49
function AddNewSite ( { context } : AddNewSiteProps ) {
54
50
const isDesktop = useViewportMatch ( 'medium' ) ;
@@ -60,6 +56,7 @@ function AddNewSite( { context }: AddNewSiteProps ) {
60
56
numberFormatOptions : { style : 'percent' } ,
61
57
} )
62
58
) ;
59
+ const { setShowHelpCenter } = useDispatch ( 'automattic/help-center' ) ;
63
60
64
61
return (
65
62
< Wrapper alignment = "flex-start" style = { { padding : '16px' } } spacing = { 6 } >
@@ -77,7 +74,12 @@ function AddNewSite( { context }: AddNewSiteProps ) {
77
74
description = { __ (
78
75
'Prompt, edit, and launch WordPress websites with Artificial Intelligence.'
79
76
) }
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
+ } }
81
83
href = { `/setup/ai-site-builder?source=${ context } &ref=new-site-popover` }
82
84
/>
83
85
< MenuItem
0 commit comments