]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18776 Fixing font color and Esc handler
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Mon, 27 Mar 2023 13:06:59 +0000 (15:06 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 27 Mar 2023 20:03:03 +0000 (20:03 +0000)
server/sonar-web/design-system/src/components/TopBar.tsx
server/sonar-web/src/main/js/app/components/nav/component/HeaderMeta.tsx
server/sonar-web/src/main/js/app/components/nav/component/branch-like/BranchLikeNavigation.tsx

index a35bd8326325fcdf2f3b528823c558798a87f75f..f808c2d17ade2bc7eb9410237a82ecfeaf889d52 100644 (file)
@@ -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')};
 `;
index f706073a9de3dcce8f2f9977e9ea465bd3ad133e..56d22719501e96acbea4f3d1a964263cd49302cd 100644 (file)
@@ -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 && <CurrentBranchLikeMergeInformation currentBranchLike={branchLike} />}
       {component.version !== undefined && isABranch && (
-        <span className="sw-ml-4 sw-whitespace-nowrap">
-          {translateWithParameters('version_x', component.version)}
-        </span>
+        <TextMuted
+          text={translateWithParameters('version_x', component.version)}
+          className="sw-ml-4 sw-whitespace-nowrap"
+        />
       )}
       {isLoggedIn(currentUser) && currentPage !== undefined && !isPullRequest(branchLike) && (
         <HomePageSelect className="sw-ml-2" currentPage={currentPage} />
index 65d4741665d51bfc9f800ad78045afb6cb73126f..c163935187bcfd59affca0b9f0133c051e721cd6 100644 (file)
@@ -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 (
     <div className="sw-flex sw-items-center sw-ml-2 it__branch-like-navigation-toggler-container">
-      <OutsideClickHandler
-        onClickOutside={() => {
+      <EscKeydownHandler
+        onKeydown={() => {
           setIsMenuOpen(false);
         }}
       >
-        <PortalPopup
-          allowResizing={true}
-          overlay={
-            isMenuOpen && (
-              <Menu
-                branchLikes={branchLikes}
-                canAdminComponent={canAdminComponent}
-                component={component}
-                currentBranchLike={currentBranchLike}
-                onClose={() => {
-                  setIsMenuOpen(false);
-                }}
-              />
-            )
-          }
-          placement={PopupPlacement.BottomLeft}
-          zLevel={PopupZLevel.Global}
+        <OutsideClickHandler
+          onClickOutside={() => {
+            setIsMenuOpen(false);
+          }}
         >
-          <ButtonSecondary
-            className="sw-max-w-abs-350"
-            onClick={() => {
-              setIsMenuOpen(!isMenuOpen);
-            }}
-            disabled={!isMenuEnabled}
-            aria-expanded={isMenuOpen}
-            aria-haspopup="menu"
+          <PortalPopup
+            allowResizing={true}
+            overlay={
+              isMenuOpen && (
+                <Menu
+                  branchLikes={branchLikes}
+                  canAdminComponent={canAdminComponent}
+                  component={component}
+                  currentBranchLike={currentBranchLike}
+                  onClose={() => {
+                    setIsMenuOpen(false);
+                  }}
+                />
+              )
+            }
+            placement={PopupPlacement.BottomLeft}
+            zLevel={PopupZLevel.Global}
           >
-            {currentBranchLikeElement}
-          </ButtonSecondary>
-        </PortalPopup>
-      </OutsideClickHandler>
+            <ButtonSecondary
+              className="sw-max-w-abs-350"
+              onClick={() => {
+                setIsMenuOpen(!isMenuOpen);
+              }}
+              disabled={!isMenuEnabled}
+              aria-expanded={isMenuOpen}
+              aria-haspopup="menu"
+            >
+              {currentBranchLikeElement}
+            </ButtonSecondary>
+          </PortalPopup>
+        </OutsideClickHandler>
+      </EscKeydownHandler>
 
       <div className="sw-ml-2">
         <BranchHelpTooltip