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

feat: log swap button click (#6654)

parent e2dd78fd
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
InterfaceEventName, InterfaceEventName,
InterfacePageName, InterfacePageName,
InterfaceSectionName, InterfaceSectionName,
SharedEventName,
SwapEventName, SwapEventName,
} from '@uniswap/analytics-events' } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'
...@@ -691,6 +692,11 @@ export function Swap({ ...@@ -691,6 +692,11 @@ export function Swap({
</ThemedText.DeprecatedMain> </ThemedText.DeprecatedMain>
</GrayCard> </GrayCard>
) : ( ) : (
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.SWAP_BUTTON}
>
<ButtonError <ButtonError
onClick={() => { onClick={() => {
if (isExpertMode) { if (isExpertMode) {
...@@ -724,6 +730,7 @@ export function Swap({ ...@@ -724,6 +730,7 @@ export function Swap({
)} )}
</Text> </Text>
</ButtonError> </ButtonError>
</TraceEvent>
)} )}
{Boolean(isExpertMode && swapError) && <SwapCallbackError error={swapError?.message} />} {Boolean(isExpertMode && swapError) && <SwapCallbackError error={swapError?.message} />}
</div> </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