@bindu-dashing/dam-solution-v2 5.8.181 → 5.8.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -109,6 +109,19 @@ const FileDetails = ({ open, handleClose, file, files, fileIds, onCloseSelection
|
|
|
109
109
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { visible: false })));
|
|
110
110
|
}
|
|
111
111
|
}, [open]);
|
|
112
|
+
// Lock body scroll when preview modal is open so drive page files don't scroll behind it
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (open && visible) {
|
|
115
|
+
const prevBodyOverflow = document.body.style.overflow;
|
|
116
|
+
const prevHtmlOverflow = document.documentElement.style.overflow;
|
|
117
|
+
document.body.style.overflow = "hidden";
|
|
118
|
+
document.documentElement.style.overflow = "hidden";
|
|
119
|
+
return () => {
|
|
120
|
+
document.body.style.overflow = prevBodyOverflow;
|
|
121
|
+
document.documentElement.style.overflow = prevHtmlOverflow;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}, [open, visible]);
|
|
112
125
|
if (!open && !visible)
|
|
113
126
|
return null;
|
|
114
127
|
const modalStyle = headerHeight > 0
|
|
@@ -13,7 +13,7 @@ const BsDownloadIcon = BsDownload;
|
|
|
13
13
|
const FileDetailsHeader = ({ handleClose, file, onCloseSelection, }) => {
|
|
14
14
|
const damConfig = useDamConfig();
|
|
15
15
|
const { isAdmin } = damConfig;
|
|
16
|
-
return (_jsxs("div", { className: "md-lib-bg-white dark:md-lib-bg-darkPrimaryHoverColor md-lib-py-3 md-lib-px-5 md-lib-border-b md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-flex md-lib-justify-between md-lib-items-center", children: [_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-5", children: [
|
|
16
|
+
return (_jsxs("div", { className: "md-lib-bg-white dark:md-lib-bg-darkPrimaryHoverColor md-lib-py-3 md-lib-px-5 md-lib-border-b md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-flex md-lib-justify-between md-lib-items-center", children: [_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-5", children: [_jsx(IoIosCloseIcon, { className: "md-lib-text-textColor dark:md-lib-text-darkTextColor md-lib-cursor-pointer", size: 24, onClick: () => handleClose === null || handleClose === void 0 ? void 0 : handleClose(), "aria-label": "Close" }), !!file && (_jsx("h4", { className: "md-lib-font-semibold md-lib-text-textColor dark:md-lib-text-darkTextColor md-lib-text-base md-lib-truncate md-lib-max-w-[calc(100vw-180px)]", title: get(file, "name", "N/A"), children: get(file, "name", "N/A") }))] }), !!file && (_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-4", children: [_jsx(FileMenuOptions, { file: file, fileIds: get(file, "_id") ? [get(file, "_id")] : [], onCloseSelection: onCloseSelection, fileModal: true }), _jsx(Button, { size: "large", className: "md-lib-bg-secondaryColor dark:md-lib-bg-darkSecondaryColor hover:md-lib-bg-secondaryHoverColor dark:hover:md-lib-bg-darkSecondaryColor md-lib-border-none", onClick: () => {
|
|
17
17
|
const url = get(file, "downloadUrl") || get(file, "s3Url") || get(file, "thumbnailUrl");
|
|
18
18
|
if (!url) {
|
|
19
19
|
showNotification(INVALID_URL, NotificationStatus.ERROR);
|