Skip to content

Commit 9af73e5

Browse files
committed
remove depth limit
1 parent 1b07123 commit 9af73e5

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

client/packages/lowcoder/src/comps/comps/navComp/components/MenuItem.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export interface IMenuItemProps {
1010
item: NavCompType;
1111
onDelete?: () => void;
1212
onAddSubMenu?: () => void;
13-
showAddSubMenu?: boolean;
1413
}
1514

1615
const MenuItemWrapper = styled.div`
@@ -43,7 +42,6 @@ const MenuItem: React.FC<IMenuItemProps> = (props) => {
4342
item,
4443
onDelete,
4544
onAddSubMenu,
46-
showAddSubMenu = true,
4745
} = props;
4846

4947
const [isConfigPopShow, showConfigPop] = useState(false);
@@ -76,7 +74,7 @@ const MenuItem: React.FC<IMenuItemProps> = (props) => {
7674
</SimplePopover>
7775
<EditPopover
7876
del={handleDel}
79-
add={showAddSubMenu && onAddSubMenu ? handleAddSubMenu : undefined}
77+
add={onAddSubMenu ? handleAddSubMenu : undefined}
8078
addText={trans("navigation.addText")}
8179
>
8280
<StyledPointIcon />

client/packages/lowcoder/src/comps/comps/navComp/components/MenuItemList.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import React, { useMemo, useCallback, createContext, useContext } from "react";
66
import styled from "styled-components";
77
import { NavCompType, NavListCompType, NavTreeItemData } from "./types";
88
import MenuItem from "./MenuItem";
9-
const MAX_DEPTH = 10;
109
const Wrapper = styled.div`
1110
.menu-title {
1211
display: flex;
@@ -56,9 +55,6 @@ const NavTreeItemComponent = React.forwardRef<
5655

5756
const handlers = useContext(MenuItemHandlersContext);
5857

59-
// allow adding sub-menu only if we are above the max depth (depth is 0-indexed)
60-
const canAddSubMenu = depth < MAX_DEPTH - 1 ;
61-
6258
const handleDelete = () => {
6359
handlers?.onDeleteItem(path);
6460
};
@@ -89,7 +85,6 @@ const NavTreeItemComponent = React.forwardRef<
8985
item={comp}
9086
onDelete={handleDelete}
9187
onAddSubMenu={handleAddSubMenu}
92-
showAddSubMenu={canAddSubMenu}
9388
/>
9489
</TreeItemContent>
9590
</SimpleTreeItemWrapper>

0 commit comments

Comments
 (0)