@@ -9,7 +9,7 @@ import CounterLabel from '../CounterLabel'
99import { useTheme } from '../ThemeProvider'
1010import { ChildWidthArray , ResponsiveProps } from './types'
1111
12- import { moreBtnStyles , getDividerStyle , getNavStyles , ulStyles , moreMenuStyles , menuItemStyles , GAP } from './styles'
12+ import { moreBtnStyles , getDividerStyle , getNavStyles , ulStyles , menuItemStyles , GAP } from './styles'
1313import styled from 'styled-components'
1414import { LoadingCounter } from './LoadingCounter'
1515
@@ -48,9 +48,8 @@ const overflowEffect = (
4848 updateListAndMenu : ( props : ResponsiveProps , iconsVisible : boolean ) => void
4949) => {
5050 let iconsVisible = true
51- let overflowStyles : BetterSystemStyleObject | null = { }
5251 if ( childWidthArray . length === 0 ) {
53- updateListAndMenu ( { items : childArray , actions : [ ] , overflowStyles } , iconsVisible )
52+ updateListAndMenu ( { items : childArray , actions : [ ] } , iconsVisible )
5453 }
5554
5655 const numberOfItemsPossible = calculatePossibleItems ( childWidthArray , navWidth )
@@ -74,7 +73,6 @@ const overflowEffect = (
7473 } else {
7574 // if we can't fit all the items without icons, we keep the icons hidden and show the rest in the menu
7675 iconsVisible = false
77- overflowStyles = moreMenuStyles
7876 for ( const [ index , child ] of childArray . entries ( ) ) {
7977 if ( index < numberOfItemsPossibleWithMoreMenu ) {
8078 items . push ( child )
@@ -89,7 +87,7 @@ const overflowEffect = (
8987 }
9088 }
9189
92- updateListAndMenu ( { items, actions, overflowStyles } , iconsVisible )
90+ updateListAndMenu ( { items, actions} , iconsVisible )
9391}
9492
9593const getValidChildren = ( children : React . ReactNode ) => {
@@ -163,10 +161,7 @@ export const UnderlineNav = forwardRef(
163161 // Add itemsToAddToMenu array's items to the menu at the index of the prospectiveListItem and remove 1 count of items (prospectiveListItem)
164162 updatedMenuItems . splice ( indexOfProspectiveListItem , 1 , ...itemsToAddToMenu )
165163 setSelectedLinkText ( prospectiveListItem . props . children )
166- callback (
167- { items : updatedItemList , actions : updatedMenuItems , overflowStyles : responsiveProps . overflowStyles } ,
168- false
169- )
164+ callback ( { items : updatedItemList , actions : updatedMenuItems } , false )
170165 }
171166 // How many items do we need to pull in to the menu to make room for the selected menu item.
172167 function getBreakpointForItemSwapping ( widthToFitIntoList : number , availableSpace : number ) {
@@ -204,8 +199,7 @@ export const UnderlineNav = forwardRef(
204199
205200 const [ responsiveProps , setResponsiveProps ] = useState < ResponsiveProps > ( {
206201 items : getValidChildren ( children ) ,
207- actions : [ ] ,
208- overflowStyles : { }
202+ actions : [ ]
209203 } )
210204
211205 const updateListAndMenu = useCallback ( ( props : ResponsiveProps , displayIcons : boolean ) => {
@@ -266,7 +260,7 @@ export const UnderlineNav = forwardRef(
266260 aria-label = { ariaLabel }
267261 ref = { navRef }
268262 >
269- < NavigationList sx = { merge < BetterSystemStyleObject > ( responsiveProps . overflowStyles , ulStyles ) } ref = { listRef } >
263+ < NavigationList sx = { ulStyles } ref = { listRef } >
270264 { responsiveProps . items }
271265 { actions . length > 0 && (
272266 < MoreMenuListItem ref = { moreMenuRef } >
0 commit comments