Skip to content
Snippets Groups Projects

feat(overlays): overlay is downloadable (MIN-237)

Merged mateusz-winiarczyk requested to merge MIN-237-overlay-is-downloadable into development
4 files
+ 39
6
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -6,10 +6,13 @@ import {
} from '@/redux/overlayBioEntity/overlayBioEntity.selector';
import { removeOverlayBioEntityForGivenOverlay } from '@/redux/overlayBioEntity/overlayBioEntity.slice';
import { getOverlayBioEntityForAllModels } from '@/redux/overlayBioEntity/overlayBioEntity.thunk';
import { BASE_API_URL } from '@/constants';
import { apiPath } from '@/redux/apiPath';
import { useEmptyBackground } from './useEmptyBackground';
type UseOverlay = {
toggleOverlay: () => void;
downloadOverlay: () => void;
isOverlayActive: boolean;
isOverlayLoading: boolean;
};
@@ -29,5 +32,9 @@ export const useOverlay = (overlayId: number): UseOverlay => {
}
};
return { toggleOverlay, isOverlayActive, isOverlayLoading };
const downloadOverlay = (): void => {
window.open(`${BASE_API_URL}/${apiPath.downloadOverlay(overlayId)}`, '_blank');
};
return { toggleOverlay, isOverlayActive, isOverlayLoading, downloadOverlay };
};
Loading