Added select all images/docs buttons IO-410

This commit is contained in:
Patrick Fic
2021-01-08 10:04:24 -08:00
parent e004abe0cf
commit ddb900bf01
6 changed files with 81 additions and 5 deletions

View File

@@ -11,24 +11,54 @@ export default function JobsDocumentsGallerySelectAllComponent({
const handleSelectAll = () => {
setGalleryImages({
...galleryImages,
other: galleryImages.other.map((i) => {
return { ...i, isSelected: true };
}),
images: galleryImages.images.map((i) => {
return { ...i, isSelected: true };
}),
});
};
const handleSelectAllImages = () => {
setGalleryImages({
...galleryImages,
images: galleryImages.images.map((i) => {
return { ...i, isSelected: true };
}),
});
};
const handleSelectAllDocuments = () => {
setGalleryImages({
...galleryImages,
other: galleryImages.other.map((i) => {
return { ...i, isSelected: true };
}),
});
};
const handleDeselectAll = () => {
setGalleryImages({
...galleryImages,
other: galleryImages.other.map((i) => {
return { ...i, isSelected: false };
}),
images: galleryImages.images.map((i) => {
return { ...i, isSelected: false };
}),
});
};
return (
<>
<Button onClick={handleSelectAll}>
{t("general.actions.selectall")}
</Button>
<Button onClick={handleSelectAllImages}>
{t("documents.actions.selectallimages")}
</Button>
<Button onClick={handleSelectAllDocuments}>
{t("documents.actions.selectallotherdocuments")}
</Button>
<Button onClick={handleDeselectAll}>
{t("general.actions.deselectall")}
</Button>