Add ability to force picker width (#1093)

This commit is contained in:
Charles Bochet
2023-08-05 15:41:18 -07:00
committed by GitHub
parent 35395c2e67
commit 14f9e892d1
7 changed files with 28 additions and 7 deletions

View File

@ -10,13 +10,14 @@ export type OwnProps = {
userId: string;
onSubmit: (newUser: EntityForSelect | null) => void;
onCancel?: () => void;
width?: number;
};
type UserForSelect = EntityForSelect & {
entityType: Entity.User;
};
export function UserPicker({ userId, onSubmit, onCancel }: OwnProps) {
export function UserPicker({ userId, onSubmit, onCancel, width }: OwnProps) {
const [searchFilter] = useRecoilScopedState(
relationPickerSearchFilterScopedState,
);
@ -44,6 +45,7 @@ export function UserPicker({ userId, onSubmit, onCancel }: OwnProps) {
return (
<SingleEntitySelect
width={width}
onEntitySelected={handleEntitySelected}
onCancel={onCancel}
entities={{