Added first round of analytics and event tracking BOD-190
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import React, { useState } from "react";
|
||||
import { useLazyQuery } from "@apollo/react-hooks";
|
||||
import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries";
|
||||
import { Input, AutoComplete } from "antd";
|
||||
import { AutoComplete, Input } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { Link } from "react-router-dom";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
export default function GlobalSearch() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -13,6 +15,8 @@ export default function GlobalSearch() {
|
||||
);
|
||||
|
||||
const handleSearch = (searchTerm) => {
|
||||
logImEXEvent("global_search", { term: searchTerm });
|
||||
|
||||
if (searchTerm.length > 0)
|
||||
callSearch({ variables: { search: searchTerm } });
|
||||
};
|
||||
@@ -129,6 +133,8 @@ export default function GlobalSearch() {
|
||||
]
|
||||
: [];
|
||||
|
||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<AutoComplete
|
||||
|
||||
Reference in New Issue
Block a user