Skip to content

Commit b411cc3

Browse files
committed
Forms: add integrations to dashboard mobile menu
1 parent 6071e61 commit b411cc3

File tree

1 file changed

+15
-1
lines changed
  • projects/packages/forms/src/dashboard/components/actions-dropdown-menu

1 file changed

+15
-1
lines changed

projects/packages/forms/src/dashboard/components/actions-dropdown-menu/index.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import jetpackAnalytics from '@automattic/jetpack-analytics';
55
import { DropdownMenu } from '@wordpress/components';
66
import { useCallback } from '@wordpress/element';
77
import { __ } from '@wordpress/i18n';
8-
import { menu, plus, download } from '@wordpress/icons';
8+
import { menu, plus, download, plugins } from '@wordpress/icons';
9+
import { useNavigate } from 'react-router';
910
/**
1011
* Internal dependencies
1112
*/
@@ -21,6 +22,7 @@ const ActionsDropdownMenu = ( { exportData }: ActionsDropdownMenuProps ) => {
2122
const { openNewForm } = useCreateForm();
2223
const { showExportModal, openModal, closeModal, onExport, autoConnectGdrive, exportLabel } =
2324
useExportResponses();
25+
const navigate = useNavigate();
2426

2527
const analyticsEvent = useCallback( () => {
2628
jetpackAnalytics.tracks.recordEvent( 'jetpack_wpa_forms_landing_page_cta_click', {
@@ -34,7 +36,19 @@ const ActionsDropdownMenu = ( { exportData }: ActionsDropdownMenuProps ) => {
3436
} );
3537
}, [ openNewForm, analyticsEvent ] );
3638

39+
const onIntegrationsClick = useCallback( () => {
40+
jetpackAnalytics.tracks.recordEvent( 'jetpack_forms_integrations_button_click', {
41+
origin: 'dashboard',
42+
} );
43+
navigate( '/integrations' );
44+
}, [ navigate ] );
45+
3746
const controls = [
47+
{
48+
icon: plugins,
49+
onClick: onIntegrationsClick,
50+
title: __( 'Integrations', 'jetpack-forms' ),
51+
},
3852
...( exportData.show
3953
? [
4054
{

0 commit comments

Comments
 (0)