@@ -16,7 +16,7 @@ type GoogleAnalyticsEventPropType = {
16
16
*/
17
17
category : string ;
18
18
/**
19
- * More precise labelling of the related action. E.g. alongside the 'Added a component' action,
19
+ * More precise labeling of the related action. E.g. alongside the 'Added a component' action,
20
20
* we could add the name of a component as the label. E.g. 'Survey', 'Heading', 'Button', etc.
21
21
*/
22
22
label ?: string ;
@@ -45,14 +45,6 @@ type ButtonProps = {
45
45
* Element used as the button label.
46
46
*/
47
47
children : React . ReactNode | string ;
48
- /**
49
- * Applies classnames to the base element.
50
- */
51
- className ?: string ;
52
- /**
53
- * Disables user interaction with the component.
54
- */
55
- disabled ?: boolean ;
56
48
/**
57
49
* Forces the component's width as wide as its parent container's width.
58
50
*/
@@ -61,19 +53,10 @@ type ButtonProps = {
61
53
* Function to be called when button is clicked.
62
54
*/
63
55
onClick ?: ( ) => void | undefined ;
64
- /**
65
- * Sets the tab index order of the base element.
66
- */
67
- tabIndex ?: string | number ;
68
56
/**
69
57
* Sets the button color theme.
70
58
*/
71
59
theme ?: 'primary' | 'secondary' ;
72
- /**
73
- * Applies a button type to the base element.
74
- */
75
- type ?: 'button' | 'reset' | 'submit' ;
76
- datum ?: any ;
77
60
} & React . ButtonHTMLAttributes < HTMLButtonElement > ;
78
61
79
62
export default function Button ( {
@@ -89,7 +72,6 @@ export default function Button({
89
72
tabIndex = 0 ,
90
73
theme = 'primary' ,
91
74
type = 'button' ,
92
- datum = '' ,
93
75
...rest
94
76
} : ButtonProps ) {
95
77
const customDataAttributes = getDataAttributes ( rest ) ;
@@ -100,11 +82,6 @@ export default function Button({
100
82
label : typeof children === 'string' ? children : undefined ,
101
83
} ;
102
84
103
- const clickHandler = ( ) => {
104
- gtag . event ( eventConfig ) ;
105
- onClick ( ) ;
106
- } ;
107
-
108
85
return (
109
86
< button
110
87
className = { classNames ( styles . Button , className , styles [ theme ] , {
@@ -113,7 +90,10 @@ export default function Button({
113
90
} ) }
114
91
data-testid = { BUTTON }
115
92
disabled = { disabled }
116
- onClick = { clickHandler }
93
+ onClick = { ( ) => {
94
+ gtag . event ( eventConfig ) ;
95
+ onClick ( ) ;
96
+ } }
117
97
tabIndex = { tabIndex }
118
98
type = { type }
119
99
{ ...customDataAttributes }
0 commit comments