@@ -4,9 +4,11 @@ import { FormattedMessage } from 'react-intl'
44import { NoirAppContext } from '../contexts'
55import { CompileOptions } from '@remix-ui/helper'
66import { compileNoirCircuit } from '../actions'
7+ import { trackMatomoEvent , MatomoCategories } from '@remix-api'
78
89const NOIR_VERSION = 'v1.0.0-beta.12'
910const BARRETENBERG_VERSION = 'v0.85.0'
11+ const MATOMO_CATEGORY = MatomoCategories . NOIR_COMPILER
1012
1113export function Container ( ) {
1214 const noirApp = useContext ( NoirAppContext )
@@ -32,17 +34,10 @@ export function Container () {
3234
3335 const handleOpenErrorLocation = async ( report : CompilerReport ) => { }
3436
35- const handleCircuitAutoCompile = ( value : boolean ) => {
36- noirApp . dispatch ( { type : 'SET_AUTO_COMPILE' , payload : value } )
37- }
38-
39- const handleCircuitHideWarnings = ( value : boolean ) => {
40- noirApp . dispatch ( { type : 'SET_HIDE_WARNINGS' , payload : value } )
41- }
42-
4337 const askGPT = async ( report : CompilerReport ) => { }
4438
4539 const handleCompileClick = ( ) => {
40+ trackMatomoEvent ( this , { category : MATOMO_CATEGORY , action : 'compile' , name : 'compile_btn_click' , isClick : true } )
4641 compileNoirCircuit ( noirApp . plugin , noirApp . appState )
4742 }
4843
@@ -51,17 +46,17 @@ export function Container () {
5146 console . error ( "No file path selected for generating proof." )
5247 return
5348 }
49+ trackMatomoEvent ( this , { category : MATOMO_CATEGORY , action : 'generate_proof' , name : 'generate_proof_btn_click' , isClick : true } )
5450 noirApp . plugin . generateProof ( noirApp . appState . filePath )
5551 }
5652
5753 const handleViewFile = ( e : React . MouseEvent < HTMLButtonElement > , filePath : string ) => {
5854 e . preventDefault ( )
55+ const fileName = filePath . split ( '/' ) . pop ( ) || filePath
56+ trackMatomoEvent ( this , { category : MATOMO_CATEGORY , action : 'view_file' , name : fileName , isClick : true } )
5957 noirApp . plugin . call ( 'fileManager' , 'open' , filePath )
6058 }
6159
62-
63- const formattedPublicInputsString = JSON . stringify ( noirApp . appState . formattedPublicInputs , null , 2 )
64-
6560 return (
6661 < section >
6762 < article >
0 commit comments