Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 534a284

Browse files
authored
fix(navi-catalog): select block on root level (#1049)
1 parent 0694b7e commit 534a284

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/components/NaviCatalog/List/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { buildLog } from '@/utils'
1111
import { SpaceGrow, Space } from '@/components/Common'
1212

1313
import type { TMenuItem } from '../spec'
14-
import { ROOT_MENU, CHILD_MENU } from '../constant'
14+
import { ROOT_MENU } from '../constant'
1515

1616
import {
1717
Wrapper,
@@ -50,17 +50,16 @@ type TProps = {
5050
withDivider: boolean
5151
showMoreItem: boolean
5252
showItemTotal: boolean
53-
5453
testid?: string
5554

56-
onSelect: (id: string, type: string) => void
55+
onItemSelect: (item: TMenuItem) => void
5756
onShowMore: () => void
5857
}
5958

6059
const List: React.FC<TProps> = ({
6160
menuMode,
6261
catalogItems,
63-
onSelect,
62+
onItemSelect,
6463
activeCatalogId,
6564
activePath,
6665
withDivider,
@@ -82,7 +81,7 @@ const List: React.FC<TProps> = ({
8281
isRootMenu={menuMode === ROOT_MENU}
8382
active={active}
8483
withDivider={withDivider}
85-
onClick={() => onSelect(item.id, item.displayType)}
84+
onClick={() => onItemSelect(item)}
8685
>
8786
{item.fixedIcon && <FixedIcon src={item.fixedIcon} />}
8887
{item.title}

src/components/NaviCatalog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const NaviCatalog: React.FC<TProps> = ({
187187
<List
188188
menuMode={menuMode}
189189
catalogItems={catalogItems}
190-
onSelect={handleMenuItemSelect}
190+
onItemSelect={handleMenuItemSelect}
191191
withDivider={withDivider}
192192
activeCatalogId={activeCatalogId}
193193
activePath={activePath}

0 commit comments

Comments
 (0)