From 24c418c8bc302f846b4ad42238158e5c5cee3322 Mon Sep 17 00:00:00 2001 From: Manuel Calavera Date: Fri, 9 Aug 2019 11:39:34 -0700 Subject: [PATCH] feat: track mixpanel search event https://app.asana.com/0/1132948208193741/1133576441333044 --- src/v2/components/Search/result.jsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/v2/components/Search/result.jsx b/src/v2/components/Search/result.jsx index ea1ef2ac..913638d8 100644 --- a/src/v2/components/Search/result.jsx +++ b/src/v2/components/Search/result.jsx @@ -3,6 +3,7 @@ import React, {memo} from 'react'; import {map} from 'lodash/fp'; import {Link} from 'react-router-dom'; import type {Validator} from 'v2/@types/validator'; +import MixPanel from 'v2/mixpanel'; import useStyles from './styles'; @@ -20,13 +21,20 @@ const SearchResult = ({ onClear, }: SearchResultProps) => { const classes = useStyles(); - const renderItem = ({nodePubkey}: {nodePubkey: string}) => ( -
  • - - {nodePubkey} - -
  • - ); + + const renderItem = ({nodePubkey}: {nodePubkey: string}) => { + const handleClick = () => { + onClear(); + MixPanel.track('Click Search Dropdown', { nodePubkey }); + }; + return ( +
  • + + {nodePubkey} + +
  • + ); + }; if ((!isDirty && !items.length) || !isFocus) { return null; }