forked from woocommerce/google-listings-and-ads
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
90 lines (86 loc) · 2.51 KB
/
index.js
File metadata and controls
90 lines (86 loc) · 2.51 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
* External dependencies
*/
import { FlexItem, Card, CardBody } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { glaData } from '.~/constants';
import AppDocumentationLink from '.~/components/app-documentation-link';
import motivationImageURL from './image.svg';
import './index.scss';
import Text from '.~/components/app-text';
import AppButton from '.~/components/app-button';
import { getSetupMCUrl } from '.~/utils/urls';
/**
* @fires gla_setup_mc with `{ triggered_by: 'start-onboarding-button', action: 'go-to-onboarding', context: 'get-started', target: 'set_up_free_listings', trigger: 'click' }`.
* @fires gla_documentation_link_click with `{ context: 'get-started', linkId: 'wp-terms-of-service', href: 'https://wordpress.com/tos/' }`.
*/
const GetStartedCard = () => {
const disableNextStep = ! glaData.mcSupportedLanguage;
return (
<Card className="gla-get-started-card" isBorderless>
<FlexItem className="motivation-image">
<img
src={ motivationImageURL }
alt={ __(
'Google Shopping search results example',
'google-listings-and-ads'
) }
width="279"
height="185"
/>
</FlexItem>
<CardBody>
<Text
variant="title-medium"
className="gla-get-started-card__title"
>
{ __(
'Get your products in front of more shoppers with Google Listings & Ads',
'google-listings-and-ads'
) }
</Text>
<AppButton
isPrimary
disabled={ disableNextStep }
href={ getSetupMCUrl() }
eventName="gla_setup_mc"
eventProps={ {
triggered_by: 'start-onboarding-button',
action: 'go-to-onboarding',
context: 'get-started',
// 'target' and 'trigger' were deprecated and can be removed after Q1 2024.
target: 'set_up_free_listings',
trigger: 'click',
} }
>
{ __(
'Start listing products →',
'google-listings-and-ads'
) }
</AppButton>
<Text className="gla-get-started-card__terms-notice">
{ createInterpolateElement(
__(
'By clicking ‘Start listing products‘, you agree to our <link>Terms of Service.</link>',
'google-listings-and-ads'
),
{
link: (
<AppDocumentationLink
context="get-started"
linkId="wp-terms-of-service"
href="https://wordpress.com/tos/"
/>
),
}
) }
</Text>
</CardBody>
</Card>
);
};
export default GetStartedCard;