File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
web/components/FileUploadInput Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ export default function FileUploadInput(props: {
8
8
disabled ?: boolean ;
9
9
loading ?: boolean ;
10
10
} ) {
11
+ const handleFileChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
12
+ props . onFileChange ( e ) ;
13
+
14
+ if ( typeof window !== 'undefined' && window . _paq && e . target . files ?. length ) {
15
+ window . _paq . push ( [ 'trackEvent' , 'AttestationUpload' , 'File' , 'Uploaded' ] ) ;
16
+ }
17
+ } ;
18
+
11
19
return (
12
20
< div
13
21
className = { classNames (
@@ -30,7 +38,7 @@ export default function FileUploadInput(props: {
30
38
< input
31
39
type = "file"
32
40
className = "absolute w-full h-full top-0 left-0 opacity-0 z-10 cursor-pointer"
33
- onChange = { props . onFileChange }
41
+ onChange = { handleFileChange }
34
42
accept = ".json"
35
43
disabled = { props . disabled || props . loading }
36
44
/>
You can’t perform that action at this time.
0 commit comments