* 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';
/>
{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} />
*/
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';
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