From 7716b317c3e872e949628205ea03667df05893ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arma=C4=9Fan?= Date: Thu, 27 Jul 2023 11:02:27 +1000 Subject: [PATCH] Take the listing html structure back to its original structure (#3559) --- src/UnderlineNav2/UnderlineNav.tsx | 13 +---- src/UnderlineNav2/UnderlineNavItem.tsx | 72 +++++++++++++------------- 2 files changed, 38 insertions(+), 47 deletions(-) diff --git a/src/UnderlineNav2/UnderlineNav.tsx b/src/UnderlineNav2/UnderlineNav.tsx index 97819919e43..38aad66a99f 100644 --- a/src/UnderlineNav2/UnderlineNav.tsx +++ b/src/UnderlineNav2/UnderlineNav.tsx @@ -310,18 +310,7 @@ export const UnderlineNav = forwardRef( ref={navRef} > - {listItems.map(listItem => { - return ( - - {listItem} - - ) - })} - + {listItems} {menuItems.length > 0 && ( {!onlyMenuVisible && } diff --git a/src/UnderlineNav2/UnderlineNavItem.tsx b/src/UnderlineNav2/UnderlineNavItem.tsx index 836b24ebb59..3ee52796667 100644 --- a/src/UnderlineNav2/UnderlineNavItem.tsx +++ b/src/UnderlineNav2/UnderlineNavItem.tsx @@ -114,43 +114,45 @@ export const UnderlineNavItem = forwardRef( ) return ( - (getLinkStyles(theme, ariaCurrent), sxProp as SxProp)} - {...props} - > - {iconsVisible && Icon && ( - - - - )} - {children && ( - - {children} - - )} - {loadingCounters ? ( - - - - ) : ( - counter !== undefined && ( + + (getLinkStyles(theme, ariaCurrent), sxProp as SxProp)} + {...props} + > + {iconsVisible && Icon && ( + + + + )} + {children && ( + + {children} + + )} + {loadingCounters ? ( - {counter} + - ) - )} - + ) : ( + counter !== undefined && ( + + {counter} + + ) + )} + + ) }, ) as PolymorphicForwardRefComponent<'a', UnderlineNavItemProps>