Update collection permissions UI (#6917)

This commit is contained in:
Tom Moor
2024-05-16 19:45:09 -04:00
committed by GitHub
parent 728c68be58
commit cae013837b
34 changed files with 1088 additions and 287 deletions

View File

@@ -23,12 +23,14 @@ import {
Placement,
} from "./ContextMenu";
import { MenuAnchorCSS } from "./ContextMenu/MenuItem";
import Separator from "./ContextMenu/Separator";
import { LabelText } from "./Input";
export type Option = {
label: string | JSX.Element;
value: string;
description?: string;
divider?: boolean;
};
export type Props = {
@@ -47,6 +49,7 @@ export type Props = {
/** @deprecated Removing soon, do not use. */
note?: React.ReactNode;
onChange?: (value: string | null) => void;
style?: React.CSSProperties;
};
export interface InputSelectRef {
@@ -247,16 +250,19 @@ const InputSelect = (props: Props, ref: React.RefObject<InputSelectRef>) => {
const isSelected = select.selectedValue === opt.value;
const Icon = isSelected ? CheckmarkIcon : Spacer;
return (
<StyledSelectOption
{...select}
value={opt.value}
key={opt.value}
ref={isSelected ? selectedRef : undefined}
>
<Icon />
&nbsp;
{labelForOption(opt)}
</StyledSelectOption>
<>
{opt.divider && <Separator />}
<StyledSelectOption
{...select}
value={opt.value}
key={opt.value}
ref={isSelected ? selectedRef : undefined}
>
<Icon />
&nbsp;
{labelForOption(opt)}
</StyledSelectOption>
</>
);
})
: null}