Added first round of analytics and event tracking BOD-190

This commit is contained in:
Patrick Fic
2020-07-17 08:27:28 -07:00
parent 3f0394760a
commit a54a85b96c
73 changed files with 433 additions and 208 deletions

View File

@@ -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