@antscorp/antsomi-ui 1.3.5-beta.609 → 1.3.5-beta.610
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.
|
@@ -10,7 +10,9 @@ import { CreateButton, HomeMenuWrapper, ModalWrapper } from './styled';
|
|
|
10
10
|
// Hooks
|
|
11
11
|
import { useHomeMenu } from './useHomeMenu';
|
|
12
12
|
export const HomeMenu = memo(props => {
|
|
13
|
-
const { children, removedDashboardId, isDashboardRemoving, type, showCreateButton, setRemovedDashboardId, onCreateNewReport,
|
|
13
|
+
const { children, removedDashboardId, isDashboardRemoving, type, showCreateButton, setRemovedDashboardId, onCreateNewReport,
|
|
14
|
+
// onMenuClick,
|
|
15
|
+
onRemoveDashboard, } = useHomeMenu(props);
|
|
14
16
|
return (React.createElement(React.Fragment, null,
|
|
15
17
|
React.createElement(HomeMenuWrapper, { gap: 10, vertical: true },
|
|
16
18
|
type !== 'recommendation' && showCreateButton && (React.createElement(CreateButton, { type: "primary", onClick: onCreateNewReport },
|
|
@@ -18,6 +20,6 @@ export const HomeMenu = memo(props => {
|
|
|
18
20
|
React.createElement(Icon, { type: "icon-ants-plus-slim", style: { fontSize: 14 } }),
|
|
19
21
|
React.createElement("span", null, "Create")))),
|
|
20
22
|
React.createElement("div", { className: "menu-list" },
|
|
21
|
-
React.createElement(ChildMenu, { items: children
|
|
23
|
+
React.createElement(ChildMenu, { items: children }))),
|
|
22
24
|
React.createElement(ModalWrapper, { open: !!removedDashboardId, centered: true, onCancel: () => setRemovedDashboardId(''), title: "Remove this dashboard", okText: "Confirm", cancelText: "Cancel", closable: false, okButtonProps: { loading: isDashboardRemoving }, onOk: onRemoveDashboard }, "Removing this dashboard will delete it permanently. Are you sure you want to perform this action?")));
|
|
23
25
|
});
|
|
@@ -203,7 +203,7 @@ export const ChildMenu = memo(props => {
|
|
|
203
203
|
const renderTitle = () => !menu_item_path || type === 'recommendation' ? (renderLabel()) : (React.createElement("div", { className: "menu-link" }, renderLabel()));
|
|
204
204
|
return {
|
|
205
205
|
key,
|
|
206
|
-
label: (React.createElement(Flex, { gap: 10, align: "center", justify: "space-between", style: { height: '100%' }, onClick: () => onClickMenuItem(item) },
|
|
206
|
+
label: (React.createElement(Flex, { gap: 10, align: "center", justify: "space-between", style: { height: '100%' }, onClick: () => type !== 'recommendation' && onClickMenuItem(item) },
|
|
207
207
|
renderIcon(),
|
|
208
208
|
React.createElement(Flex, { style: styles.menuItemTitle, align: "center" }, renderTitle()))),
|
|
209
209
|
disabled,
|