Context menu for left pane list items

This commit is contained in:
Fedor Indutny 2023-04-05 13:48:00 -07:00 committed by GitHub
parent 02dedc7157
commit f61d8f38b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 1046 additions and 110 deletions

View file

@ -12,6 +12,7 @@ export type Props = {
subtitle?: string | JSX.Element;
leading?: string | JSX.Element;
trailing?: string | JSX.Element;
moduleClassName?: string;
onClick?: () => void;
onContextMenu?: (ev: React.MouseEvent<Element, MouseEvent>) => void;
// show hover highlight,
@ -28,8 +29,6 @@ export type Props = {
testId?: string;
};
const getClassName = getClassNamesFor('ListTile');
/**
* A single row that typically contains some text and leading/trailing icons/widgets
*
@ -72,6 +71,7 @@ const ListTileImpl = React.forwardRef<HTMLButtonElement, Props>(
subtitle,
leading,
trailing,
moduleClassName,
onClick,
onContextMenu,
clickable,
@ -85,6 +85,8 @@ const ListTileImpl = React.forwardRef<HTMLButtonElement, Props>(
) {
const isClickable = clickable ?? Boolean(onClick);
const getClassName = getClassNamesFor('ListTile', moduleClassName);
const rootProps = {
className: classNames(
getClassName(''),