Skip to content

Commit

Permalink
Take the listing html structure back to its original structure (#3559)
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolinisoup authored Jul 27, 2023
1 parent 430a203 commit 7716b31
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 47 deletions.
13 changes: 1 addition & 12 deletions src/UnderlineNav2/UnderlineNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,7 @@ export const UnderlineNav = forwardRef(
ref={navRef}
>
<NavigationList sx={ulStyles} ref={listRef} role="list">
{listItems.map(listItem => {
return (
<Box
key={listItem.props.children}
as="li"
sx={{display: 'flex', flexDirection: 'column', alignItems: 'center'}}
>
{listItem}
</Box>
)
})}

{listItems}
{menuItems.length > 0 && (
<MoreMenuListItem ref={moreMenuRef}>
{!onlyMenuVisible && <Box sx={getDividerStyle(theme)}></Box>}
Expand Down
72 changes: 37 additions & 35 deletions src/UnderlineNav2/UnderlineNavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,43 +114,45 @@ export const UnderlineNavItem = forwardRef(
)

return (
<Link
ref={ref}
as={Component}
href={href}
aria-current={ariaCurrent}
onKeyDown={keyDownHandler}
onClick={clickHandler}
sx={merge<BetterSystemStyleObject>(getLinkStyles(theme, ariaCurrent), sxProp as SxProp)}
{...props}
>
{iconsVisible && Icon && (
<Box as="span" data-component="icon" sx={iconWrapStyles}>
<Icon />
</Box>
)}
{children && (
<Box
as="span"
data-component="text"
data-content={children}
sx={Boolean(ariaCurrent) && ariaCurrent !== 'false' ? {fontWeight: 600} : {}}
>
{children}
</Box>
)}
{loadingCounters ? (
<Box as="span" data-component="counter" sx={counterStyles}>
<LoadingCounter />
</Box>
) : (
counter !== undefined && (
<Box as="li" sx={{display: 'flex', flexDirection: 'column', alignItems: 'center'}}>
<Link
ref={ref}
as={Component}
href={href}
aria-current={ariaCurrent}
onKeyDown={keyDownHandler}
onClick={clickHandler}
sx={merge<BetterSystemStyleObject>(getLinkStyles(theme, ariaCurrent), sxProp as SxProp)}
{...props}
>
{iconsVisible && Icon && (
<Box as="span" data-component="icon" sx={iconWrapStyles}>
<Icon />
</Box>
)}
{children && (
<Box
as="span"
data-component="text"
data-content={children}
sx={Boolean(ariaCurrent) && ariaCurrent !== 'false' ? {fontWeight: 600} : {}}
>
{children}
</Box>
)}
{loadingCounters ? (
<Box as="span" data-component="counter" sx={counterStyles}>
<CounterLabel>{counter}</CounterLabel>
<LoadingCounter />
</Box>
)
)}
</Link>
) : (
counter !== undefined && (
<Box as="span" data-component="counter" sx={counterStyles}>
<CounterLabel>{counter}</CounterLabel>
</Box>
)
)}
</Link>
</Box>
)
},
) as PolymorphicForwardRefComponent<'a', UnderlineNavItemProps>
Expand Down

0 comments on commit 7716b31

Please sign in to comment.