Skip to content

Commit

Permalink
fix: fix issue with the swap label don't showing (#4789)
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin authored Aug 14, 2024
1 parent 46add78 commit 63c0f55
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ export function TradeWidgetLinks({
location.pathname,
highlightedBadgeText,
highlightedBadgeType,
handleMenuItemClick
handleMenuItemClick,
])

const singleMenuItem = menuItemsElements.length === 1

const selectedMenuItem = menuItemsElements.find((item) => item.props.isActive) || menuItemsElements[0]

return isDropdown ? (
<>
<styledEl.MenuItem
onClick={() => !singleMenuItem && setDropdownVisible(!isDropdownVisible)}
isDropdownVisible={isDropdownVisible}
>
<styledEl.Link to={menuItemsElements.find((item) => item.props.isActive)?.props.routePath || '#'}>
<Trans>
{menuItemsElements.find((item) => item.props.isActive)?.props.item.label}
{!singleMenuItem ? <SVG src={IMAGE_CARET} title="select" /> : null}
</Trans>
<styledEl.Link to={selectedMenuItem.props.routePath || '#'}>
{selectedMenuItem.props.item.label}
{!singleMenuItem ? <SVG src={IMAGE_CARET} title="select" /> : null}
</styledEl.Link>
</styledEl.MenuItem>

Expand Down

0 comments on commit 63c0f55

Please sign in to comment.