@@ -39,7 +39,13 @@ const makeThrottleScroll = () =>
3939 onActiveSubMenuId ( subMenuId )
4040 } )
4141
42- const List = ( { onActiveMenuGroupId, onActiveSubMenuId, getComponent } ) => {
42+ const List = ( {
43+ onActiveMenuGroupId,
44+ onActiveSubMenuId,
45+ getComponent,
46+ dashboardOptions = { firstMenuGroup : true , onboarding : true } ,
47+ } ) => {
48+ const { firstMenuGroup, onboarding } = dashboardOptions
4349 const container = useContainer ( )
4450 const ids = useMenuGroupIds ( )
4551
@@ -49,30 +55,37 @@ const List = ({ onActiveMenuGroupId, onActiveSubMenuId, getComponent }) => {
4955 const widthRef = useRef ( 0 )
5056
5157 const rowRenderMeasurer = useMemo (
52- ( ) => ( { index, parent, key, style, isScrolling, isVisible } ) => {
53- const id = ids [ index ]
54- return (
55- < CellMeasurer
56- cache = { cache }
57- columnIndex = { 0 }
58- key = { key }
59- parent = { parent }
60- rowIndex = { index }
61- width = { widthRef . current }
62- >
63- { ( { measure } ) => {
64- measures . current [ id ] = measure
65- const Component = getComponent ( id , index )
66-
67- return (
68- < CellMeasurerWrapper style = { style } index = { index } id = { id } measure = { measure } >
69- < Component id = { id } isVisible = { isVisible } isScrolling = { isScrolling } />
70- </ CellMeasurerWrapper >
71- )
72- } }
73- </ CellMeasurer >
74- )
75- } ,
58+ ( ) =>
59+ ( { index, parent, key, style, isScrolling, isVisible } ) => {
60+ const id = ids [ index ]
61+ return (
62+ < CellMeasurer
63+ cache = { cache }
64+ columnIndex = { 0 }
65+ key = { key }
66+ parent = { parent }
67+ rowIndex = { index }
68+ width = { widthRef . current }
69+ >
70+ { ( { measure } ) => {
71+ measures . current [ id ] = measure
72+ const hasFirstMenuGroup = index === 0 && firstMenuGroup
73+ const Component = getComponent ( id , hasFirstMenuGroup )
74+
75+ return (
76+ < CellMeasurerWrapper style = { style } index = { index } id = { id } measure = { measure } >
77+ < Component
78+ id = { id }
79+ isVisible = { isVisible }
80+ isScrolling = { isScrolling }
81+ onboarding = { onboarding }
82+ />
83+ </ CellMeasurerWrapper >
84+ )
85+ } }
86+ </ CellMeasurer >
87+ )
88+ } ,
7689 [ ids . length ]
7790 )
7891
0 commit comments