From 63c0f55c3a5e6565484708fc0bb27251843cf1ee Mon Sep 17 00:00:00 2001 From: Anxo Rodriguez Date: Wed, 14 Aug 2024 14:53:49 +0100 Subject: [PATCH] fix: fix issue with the swap label don't showing (#4789) --- .../trade/containers/TradeWidgetLinks/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/cowswap-frontend/src/modules/trade/containers/TradeWidgetLinks/index.tsx b/apps/cowswap-frontend/src/modules/trade/containers/TradeWidgetLinks/index.tsx index fb8bb55242..cb7c298f86 100644 --- a/apps/cowswap-frontend/src/modules/trade/containers/TradeWidgetLinks/index.tsx +++ b/apps/cowswap-frontend/src/modules/trade/containers/TradeWidgetLinks/index.tsx @@ -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 ? ( <> !singleMenuItem && setDropdownVisible(!isDropdownVisible)} isDropdownVisible={isDropdownVisible} > - item.props.isActive)?.props.routePath || '#'}> - - {menuItemsElements.find((item) => item.props.isActive)?.props.item.label} - {!singleMenuItem ? : null} - + + {selectedMenuItem.props.item.label} + {!singleMenuItem ? : null}