forked from woocommerce/google-listings-and-ads
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp-icon-button.js
More file actions
48 lines (43 loc) · 1.19 KB
/
help-icon-button.js
File metadata and controls
48 lines (43 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import GridiconHelpOutline from 'gridicons/dist/help-outline';
/**
* Internal dependencies
*/
import AppIconButton from '.~/components/app-icon-button';
/**
* "Help" button is clicked.
*
* @event gla_help_click
* @property {string} context Indicates the place where the button is located, e.g. `setup-ads`.
*/
/**
* An AppIconButton that renders GridiconHelpOutline icon and "Help" text.
* Upon click, it will open documentation page in a new tab,
* and call `gla_help_click` track event.
*
* @fires gla_help_click
*
* @param {Object} props Props
* @param {string} props.eventContext Context to be used in `gla_help_click` track event.
* @return {import(".~/components/app-icon-button").default} The button.
*/
const HelpIconButton = ( props ) => {
const { eventContext, ...rest } = props;
return (
<AppIconButton
icon={ <GridiconHelpOutline /> }
text={ __( 'Help', 'google-listings-and-ads' ) }
href="https://woo.com/document/google-listings-and-ads/"
target="_blank"
eventName="gla_help_click"
eventProps={ {
context: eventContext,
} }
{ ...rest }
/>
);
};
export default HelpIconButton;