[Backport 5.2] code-search: properly display disabled bulk operations (#58476)

code-search: properly display disabled bulk operations (#58461)

* properly display disabled menu items

* prettier

(cherry picked from commit db520b0871)

Co-authored-by: Bolaji Olajide <25608335+BolajiOlajide@users.noreply.github.com>
This commit is contained in:
sourcegraph-release-guild-bot 2023-11-29 09:39:59 -05:00 committed by GitHub
parent babe69aff6
commit cbc410f2c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -12,8 +12,18 @@
.menu-list-item {
padding: 0.5rem 1rem;
cursor: pointer;
&[data-reach-menu-item]:active {
&[data-reach-menu-item][aria-disabled='false']:active {
--text-muted: var(--white);
}
&[data-reach-menu-item][aria-disabled='true']:hover {
background-color: transparent;
}
&[data-reach-menu-item][aria-disabled='true'] {
cursor: not-allowed;
opacity: 0.7;
}
}

View File

@ -2,6 +2,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { mdiChevronDown } from '@mdi/js'
import { VisuallyHidden } from '@reach/visually-hidden'
import classNames from 'classnames'
import {
ProductStatusBadge,
@ -179,7 +180,11 @@ const DropdownItem: React.FunctionComponent<React.PropsWithChildren<DropdownItem
return (
<MenuItem className={styles.menuListItem} onSelect={onSelect} disabled={action.disabled}>
<H4 className="mb-1">
<H4
className={classNames('mb-1', {
'text-muted': action.disabled,
})}
>
{action.dropdownTitle}
{action.experimental && (
<>