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

@@ -2,11 +2,14 @@ import { Button } from "antd";
import axios from "axios";
import React from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function JobsDocumentsDownloadButton({ galleryImages }) {
const { t } = useTranslation();
const imagesToDownload = galleryImages.filter((image) => image.isSelected);
const handleDelete = () => {
const handleDownload = () => {
logImEXEvent("jobs_documents_download");
axios
.post("/media/download", {
ids: imagesToDownload.map((_) => _.key),
@@ -17,7 +20,7 @@ export default function JobsDocumentsDownloadButton({ galleryImages }) {
};
return (
<Button disabled={imagesToDownload.length < 1} onClick={handleDelete}>
<Button disabled={imagesToDownload.length < 1} onClick={handleDownload}>
{t("documents.actions.download")}
</Button>
);