@topconsultnpm/sdkui-react-beta 6.12.65 → 6.12.66
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.
@@ -79,6 +79,8 @@ interface TMBlogsProps {
|
|
79
79
|
showCommentFormCallback?: () => void;
|
80
80
|
/** Show Task Form Callback */
|
81
81
|
showTaskFormCallback?: () => void;
|
82
|
+
/** Optional Whether to enable the context menu */
|
83
|
+
showContextMenu?: boolean;
|
82
84
|
}
|
83
85
|
declare const TMBlogs: (props: TMBlogsProps) => import("react/jsx-runtime").JSX.Element;
|
84
86
|
export default TMBlogs;
|
@@ -25,7 +25,7 @@ const TMBlogs = (props) => {
|
|
25
25
|
isRestoreEnabled: false,
|
26
26
|
isRefreshEnabled: false,
|
27
27
|
isCreateContextualTask: false,
|
28
|
-
}, refreshCallback, newPosts = [], showCommentFormCallback, showTaskFormCallback } = props;
|
28
|
+
}, refreshCallback, newPosts = [], showCommentFormCallback, showTaskFormCallback, showContextMenu = true } = props;
|
29
29
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
30
30
|
const deviceType = useDeviceType();
|
31
31
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
@@ -537,7 +537,7 @@ const TMBlogs = (props) => {
|
|
537
537
|
return;
|
538
538
|
event.preventDefault();
|
539
539
|
setAnchorEl(event.currentTarget);
|
540
|
-
setMenuItems(contextMenuItems);
|
540
|
+
setMenuItems(showContextMenu ? contextMenuItems : []);
|
541
541
|
};
|
542
542
|
// Handle closing the context menu
|
543
543
|
const closeContextMenu = useCallback(() => {
|