This repository was archived by the owner on Dec 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
client/me/purchases/cancel-purchase Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ const CancelPurchase = React.createClass( {
60
60
</ h2 >
61
61
62
62
< div className = "cancel-purchase__info" >
63
- < CancelPurchaseSupportBox />
63
+ < CancelPurchaseSupportBox purchase = { purchase } />
64
64
65
65
< div className = "cancel-purchase__content" >
66
66
< div className = "cancel-purchase__section" >
Original file line number Diff line number Diff line change 3
3
*/
4
4
import React from 'react' ;
5
5
6
+ /**
7
+ * Internal Dependencies
8
+ */
9
+ import analytics from 'analytics' ;
10
+
6
11
const CancelPurchaseSupportBox = React . createClass ( {
12
+ propTypes : {
13
+ purchase : React . PropTypes . object . isRequired ,
14
+ } ,
15
+
16
+ trackClickContactSupport ( ) {
17
+ if ( ! this . props . purchase ) {
18
+ return ;
19
+ }
20
+
21
+ analytics . tracks . recordEvent (
22
+ 'calypso_purchases_click_contact_support' ,
23
+ { product_slug : this . props . purchase . productSlug }
24
+ ) ;
25
+ } ,
26
+
7
27
render ( ) {
8
28
const contactSupportUrl = 'https://support.wordpress.com/' ;
9
29
@@ -20,14 +40,15 @@ const CancelPurchaseSupportBox = React.createClass( {
20
40
'If you are unsure about canceling or have any questions about this purchase, please {{a}}contact support{{/a}}.' ,
21
41
{
22
42
components : {
23
- a : < a href = { contactSupportUrl } target = "_blank" />
43
+ a : < a href = { contactSupportUrl } target = "_blank" onClick = { this . trackClickContactSupport } />
24
44
}
25
45
}
26
46
) }
27
47
</ p >
28
48
29
49
< a href = { contactSupportUrl }
30
50
target = "_blank"
51
+ onClick = { this . trackClickContactSupport }
31
52
className = "button is-primary" >
32
53
{ this . translate ( 'Contact Support' ) }
33
54
</ a >
You can’t perform that action at this time.
0 commit comments