From c4903aec124f7f778486fdc9fcae1d33abe4ca73 Mon Sep 17 00:00:00 2001 From: Anna Gavrilman Date: Tue, 14 Nov 2023 10:38:38 -0500 Subject: [PATCH] Header nav links fixes (#1988) --- .../public/src/components/AnonymousMenu.js | 21 ++++++++------ frontend/public/src/components/UserMenu.js | 29 +++++++++---------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/frontend/public/src/components/AnonymousMenu.js b/frontend/public/src/components/AnonymousMenu.js index 7c52d4120b..585a675b36 100644 --- a/frontend/public/src/components/AnonymousMenu.js +++ b/frontend/public/src/components/AnonymousMenu.js @@ -13,6 +13,15 @@ type Props = { const AnonymousMenu = ({ mobileView }: Props) => { const identifierPostfix = mobileView ? "Mobile" : "Desktop" const newDesign = checkFeatureFlag("mitxonline-new-header", "anonymousUser") + const makeNavLink = (text: string) => { + return mobileView ? ( + + {text} + + ) : ( + text + ) + } return ( diff --git a/frontend/public/src/components/UserMenu.js b/frontend/public/src/components/UserMenu.js index f4b6bc39dd..dd50724d9a 100644 --- a/frontend/public/src/components/UserMenu.js +++ b/frontend/public/src/components/UserMenu.js @@ -46,6 +46,15 @@ const UserMenu = ({ currentUser, useScreenOverlay }: Props) => { "mitxonline-new-header", currentUser && currentUser.id ? currentUser.id : "anonymousUser" ) + const makeNavLink = (text: string) => { + return useScreenOverlay ? ( + + {text} + + ) : ( + text + ) + } menuChildProps = useScreenOverlay ? { li: overlayListItemProps, @@ -78,39 +87,29 @@ const UserMenu = ({ currentUser, useScreenOverlay }: Props) => { >
  • - - Profile - + {makeNavLink("Profile")}
  • {showNewDesign && useScreenOverlay ? (
  • - - Catalog - + {makeNavLink("Catalog")}
  • ) : null}
  • - - Dashboard - + {makeNavLink("Dashboard")}
  • - - Account - + {makeNavLink("Account")}
  • - - Order History - + {makeNavLink("Order History")}