Commit 9b07ac2b authored by Greg Bugyis's avatar Greg Bugyis Committed by GitHub

feat: log token explore search event (#4695)

* Log token explore search event

* Move event directly above target element
parent 571a49ba
......@@ -8,6 +8,7 @@ export enum EventName {
APP_LOADED = 'Application Loaded',
APPROVE_TOKEN_TXN_SUBMITTED = 'Approve Token Transaction Submitted',
CONNECT_WALLET_BUTTON_CLICKED = 'Connect Wallet Button Clicked',
EXPLORE_SEARCH_SELECTED = 'Explore Search Selected',
EXPLORE_TOKEN_ROW_CLICKED = 'Explore Token Row Clicked',
PAGE_VIEWED = 'Page Viewed',
SWAP_AUTOROUTER_VISUALIZATION_EXPANDED = 'Swap Autorouter Visualization Expanded',
......@@ -106,6 +107,7 @@ export enum ElementName {
COMMON_BASES_CURRENCY_BUTTON = 'common-bases-currency-button',
CONFIRM_SWAP_BUTTON = 'confirm-swap-or-send',
CONNECT_WALLET_BUTTON = 'connect-wallet-button',
EXPLORE_SEARCH_INPUT = 'explore_search_input',
IMPORT_TOKEN_BUTTON = 'import-token-button',
MAX_TOKEN_AMOUNT_BUTTON = 'max-token-amount-button',
PRICE_UPDATE_ACCEPT_BUTTON = 'price-update-accept-button',
......
import { Trans } from '@lingui/macro'
import { ElementName, Event, EventName } from 'analytics/constants'
import { TraceEvent } from 'analytics/TraceEvent'
import searchIcon from 'assets/svg/search.svg'
import xIcon from 'assets/svg/x.svg'
import useDebounce from 'hooks/useDebounce'
......@@ -76,6 +78,11 @@ export default function SearchBar() {
<SearchBarContainer>
<Trans
render={({ translation }) => (
<TraceEvent
events={[Event.onSelect]}
name={EventName.EXPLORE_SEARCH_SELECTED}
element={ElementName.EXPLORE_SEARCH_INPUT}
>
<SearchInput
type="search"
placeholder={`${translation}`}
......@@ -84,6 +91,7 @@ export default function SearchBar() {
value={localFilterString}
onChange={({ target: { value } }) => setLocalFilterString(value)}
/>
</TraceEvent>
)}
>
Filter tokens
......
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