Skip to content

Commit

Permalink
chore: add token import mixpanel event (#7360)
Browse files Browse the repository at this point in the history
Co-authored-by: woody <[email protected]>
  • Loading branch information
0xApotheosis and woodenfurniture authored Jul 11, 2024
1 parent 9ebd49c commit 11bf6ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { WarningAcknowledgement } from 'components/Acknowledgement/Acknowledgeme
import { AssetIcon } from 'components/AssetIcon'
import { InlineCopyButton } from 'components/InlineCopyButton'
import { useToggle } from 'hooks/useToggle/useToggle'
import { getMixPanel } from 'lib/mixpanel/mixPanelSingleton'
import { MixPanelEvent } from 'lib/mixpanel/types'
import { middleEllipsis } from 'lib/utils'
import { assets as assetsSlice } from 'state/slices/assetsSlice/assetsSlice'
import { marketData as marketDataSlice } from 'state/slices/marketDataSlice/marketDataSlice'
Expand Down Expand Up @@ -66,6 +68,10 @@ export const CustomAssetAcknowledgement: React.FC<CustomAssetAcknowledgementProp
const onImportClick = useCallback(() => {
if (!asset) return

getMixPanel()?.track(MixPanelEvent.CustomAssetAdded, {
asset,
})

// Add asset to the store
dispatch(assetsSlice.actions.upsertAsset(asset))

Expand Down
1 change: 1 addition & 0 deletions src/lib/mixpanel/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export enum MixPanelEvent {
LpIncompleteDepositConfirm = 'LP Incomplete Deposit Confirm',
LpIncompleteWithdrawPreview = 'LP Incomplete Withdraw Preview',
LpIncompleteWithdrawConfirm = 'LP Incomplete Withdraw Confirm',
CustomAssetAdded = 'Custom Asset Added',
}

export type TrackOpportunityProps = {
Expand Down

0 comments on commit 11bf6ee

Please sign in to comment.