Commit b57a5d7d authored by eddie's avatar eddie Committed by GitHub

feat: log swap button click (#6654)

parent e2dd78fd
......@@ -6,6 +6,7 @@ import {
InterfaceEventName,
InterfacePageName,
InterfaceSectionName,
SharedEventName,
SwapEventName,
} from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'
......@@ -691,6 +692,11 @@ export function Swap({
</ThemedText.DeprecatedMain>
</GrayCard>
) : (
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.SWAP_BUTTON}
>
<ButtonError
onClick={() => {
if (isExpertMode) {
......@@ -724,6 +730,7 @@ export function Swap({
)}
</Text>
</ButtonError>
</TraceEvent>
)}
{Boolean(isExpertMode && swapError) && <SwapCallbackError error={swapError?.message} />}
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment