BOD-25 BOD-24 Uploading to cloudinary + thumbnail generation

This commit is contained in:
Patrick Fic
2020-04-20 14:14:41 -07:00
parent d3b36776c9
commit 01e6e78c71
33 changed files with 784 additions and 540 deletions

View File

@@ -0,0 +1,24 @@
import { Button, notification } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import axios from "axios";
export default function JobsDocumentsDownloadButton({ galleryImages }) {
const { t } = useTranslation();
const imagesToDownload = galleryImages.filter((image) => image.isSelected);
const handleDelete = () => {
axios
.post("/media/download", {
ids: imagesToDownload.map((_) => _.key),
})
.then((r) => {
window.open(r.data);
});
};
return (
<Button disabled={imagesToDownload.length < 1} onClick={handleDelete}>
{t("documents.actions.download")}
</Button>
);
}