add matomo tracking

pull/3543/head
Aniket-Engg 2 years ago committed by Aniket
parent a1264db2aa
commit 4dea9f7b5b
  1. 3
      libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx

@ -8,6 +8,7 @@ import { saveAs } from 'file-saver'
import './css/style.css' import './css/style.css'
import { CustomTooltip } from '@remix-ui/helper' import { CustomTooltip } from '@remix-ui/helper'
const _paq = window._paq = window._paq || []
export const ContractSelection = (props: ContractSelectionProps) => { export const ContractSelection = (props: ContractSelectionProps) => {
const { api, compiledFileName, contractsDetails, contractList, compilerInput, modal } = props const { api, compiledFileName, contractsDetails, contractList, compilerInput, modal } = props
@ -142,6 +143,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
} }
const details = () => { const details = () => {
_paq.push(['trackEvent', 'compiler', 'compilerDetails', 'display'])
if (!selectedContract) throw new Error('No contract compiled yet') if (!selectedContract) throw new Error('No contract compiled yet')
const help = { const help = {
@ -185,6 +187,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
</TreeView> </TreeView>
</div> </div>
const downloadFn = () => { const downloadFn = () => {
_paq.push(['trackEvent', 'compiler', 'compilerDetails', 'download'])
saveAs(new Blob([JSON.stringify(contractProperties, null, '\t')]), `${selectedContract}_compData.json`) saveAs(new Blob([JSON.stringify(contractProperties, null, '\t')]), `${selectedContract}_compData.json`)
} }
modal(selectedContract, log, 'Download', downloadFn, 'Close', null) modal(selectedContract, log, 'Download', downloadFn, 'Close', null)

Loading…
Cancel
Save