Skip to content

Commit

Permalink
Rm PROPOSE_TX, rename TOGGLE_EXECUTE_TX, fix SIMULATE_TX
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Nov 9, 2023
1 parent bd2844b commit 6ee3c15
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/components/tx/ExecuteCheckbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ExecuteCheckbox = ({ onChange }: { onChange: (checked: boolean) => void })

const handleChange = (_: ChangeEvent<HTMLInputElement>, value: string) => {
const checked = value === 'true'
trackEvent({ ...MODALS_EVENTS.EXECUTE_TX, label: checked })
trackEvent({ ...MODALS_EVENTS.TOGGLE_EXECUTE_TX, label: checked })
dispatch(setTransactionExecution(checked))
onChange(checked)
}
Expand Down
22 changes: 13 additions & 9 deletions src/components/tx/security/tenderly/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import sharedCss from '@/components/tx/security/shared/styles.module.css'
import { TxInfoContext } from '@/components/tx-flow/TxInfoProvider'
import { SafeTxContext } from '@/components/tx-flow/SafeTxProvider'
import InfoIcon from '@/public/images/notifications/info.svg'
import Track from '@/components/common/Track'
import { MODALS_EVENTS } from '@/services/analytics'

export type TxSimulationProps = {
transactions?: SimulationTxParams['transactions']
Expand Down Expand Up @@ -112,15 +114,17 @@ const TxSimulationBlock = ({ transactions, disabled, gasLimit }: TxSimulationPro
</Typography>
)
) : (
<Button
variant="outlined"
size="small"
className={css.simulate}
onClick={handleSimulation}
disabled={!transactions || disabled}
>
Simulate
</Button>
<Track {...MODALS_EVENTS.SIMULATE_TX}>
<Button
variant="outlined"
size="small"
className={css.simulate}
onClick={handleSimulation}
disabled={!transactions || disabled}
>
Simulate
</Button>
</Track>
)}
</div>
</Paper>
Expand Down
12 changes: 2 additions & 10 deletions src/services/analytics/events/modals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const MODALS_EVENTS = {
action: 'Estimation',
category: MODALS_CATEGORY,
},
EXECUTE_TX: {
action: 'Execute transaction',
TOGGLE_EXECUTE_TX: {
action: 'Toggle execute transaction',
category: MODALS_CATEGORY,
},
USE_SPENDING_LIMIT: {
Expand All @@ -44,18 +44,10 @@ export const MODALS_EVENTS = {
action: 'Simulate transaction',
category: MODALS_CATEGORY,
},
REJECT_TX: {
action: 'Reject transaction',
category: MODALS_CATEGORY,
},
EDIT_APPROVALS: {
action: 'Edit approval',
category: MODALS_CATEGORY,
},
PROPOSE_TX: {
action: 'Propose transaction',
category: MODALS_CATEGORY,
},
ACCEPT_RISK: {
action: 'Accept transaction risk',
category: MODALS_CATEGORY,
Expand Down

0 comments on commit 6ee3c15

Please sign in to comment.