From 36c31f9ae8054d3b68cde1fb4a2940231f27f572 Mon Sep 17 00:00:00 2001 From: Revanshu Paliwal Date: Mon, 27 Mar 2023 15:06:59 +0200 Subject: [PATCH] SONAR-18776 Fixing font color and Esc handler --- .../design-system/src/components/TopBar.tsx | 4 +- .../components/nav/component/HeaderMeta.tsx | 8 ++- .../branch-like/BranchLikeNavigation.tsx | 69 ++++++++++--------- 3 files changed, 45 insertions(+), 36 deletions(-) diff --git a/server/sonar-web/design-system/src/components/TopBar.tsx b/server/sonar-web/design-system/src/components/TopBar.tsx index a35bd832632..f808c2d17ad 100644 --- a/server/sonar-web/design-system/src/components/TopBar.tsx +++ b/server/sonar-web/design-system/src/components/TopBar.tsx @@ -45,6 +45,6 @@ const BaseStyle = styled.nav` ${tw`sw-font-sans`} ${tw`sw-text-sm`} - background-color: ${themeColor('backgroundPrimary')}; - color: ${themeContrast('backgroundPrimary')}; + background-color: ${themeColor('navbar')}; + color: ${themeContrast('navbar')}; `; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx b/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx index f706073a9de..56d22719501 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { TextMuted } from 'design-system'; import * as React from 'react'; import HomePageSelect from '../../../../components/controls/HomePageSelect'; import { isBranch, isPullRequest } from '../../../../helpers/branch-like'; @@ -71,9 +72,10 @@ export function HeaderMeta(props: HeaderMetaProps) { /> {branchLike && } {component.version !== undefined && isABranch && ( - - {translateWithParameters('version_x', component.version)} - + )} {isLoggedIn(currentUser) && currentPage !== undefined && !isPullRequest(branchLike) && ( diff --git a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx index 65d4741665d..c163935187b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx @@ -19,6 +19,7 @@ */ import { ButtonSecondary, PopupPlacement, PopupZLevel, PortalPopup } from 'design-system'; import * as React from 'react'; +import EscKeydownHandler from '../../../../../components/controls/EscKeydownHandler'; import OutsideClickHandler from '../../../../../components/controls/OutsideClickHandler'; import { AlmKeys, ProjectAlmBindingResponse } from '../../../../../types/alm-settings'; import { BranchLike } from '../../../../../types/branch-like'; @@ -64,42 +65,48 @@ export function BranchLikeNavigation(props: BranchLikeNavigationProps) { return (
- { + { setIsMenuOpen(false); }} > - { - setIsMenuOpen(false); - }} - /> - ) - } - placement={PopupPlacement.BottomLeft} - zLevel={PopupZLevel.Global} + { + setIsMenuOpen(false); + }} > - { - setIsMenuOpen(!isMenuOpen); - }} - disabled={!isMenuEnabled} - aria-expanded={isMenuOpen} - aria-haspopup="menu" + { + setIsMenuOpen(false); + }} + /> + ) + } + placement={PopupPlacement.BottomLeft} + zLevel={PopupZLevel.Global} > - {currentBranchLikeElement} - - - + { + setIsMenuOpen(!isMenuOpen); + }} + disabled={!isMenuEnabled} + aria-expanded={isMenuOpen} + aria-haspopup="menu" + > + {currentBranchLikeElement} + + + +