|
|
|
@ -31,19 +31,38 @@ export default function CreateListDialog({
|
|
|
|
|
reset();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleFormSubmit = handleSubmit(async (data) => {
|
|
|
|
|
await onSubmit(data);
|
|
|
|
|
reset();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Dialog
|
|
|
|
|
isShown={show}
|
|
|
|
|
primaryButton={undefined}
|
|
|
|
|
primaryButton={
|
|
|
|
|
<Button
|
|
|
|
|
disabled={!isDirty}
|
|
|
|
|
display="inline"
|
|
|
|
|
isLoading={isSubmitting}
|
|
|
|
|
label="Create"
|
|
|
|
|
size="md"
|
|
|
|
|
type="submit"
|
|
|
|
|
variant="primary"
|
|
|
|
|
onClick={handleFormSubmit}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
secondaryButton={
|
|
|
|
|
<Button
|
|
|
|
|
display="inline"
|
|
|
|
|
label="Cancel"
|
|
|
|
|
size="md"
|
|
|
|
|
variant="tertiary"
|
|
|
|
|
onClick={handleDialogCancel}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
title="Create question list"
|
|
|
|
|
onClose={handleDialogCancel}>
|
|
|
|
|
<form
|
|
|
|
|
className="mt-5 gap-2 sm:flex sm:items-center"
|
|
|
|
|
onSubmit={handleSubmit(async (data) => {
|
|
|
|
|
await onSubmit(data);
|
|
|
|
|
reset();
|
|
|
|
|
})}>
|
|
|
|
|
<div className="w-full sm:max-w-xs">
|
|
|
|
|
<form className="w-full" onSubmit={handleFormSubmit}>
|
|
|
|
|
<TextInput
|
|
|
|
|
id="listName"
|
|
|
|
|
isLabelHidden={true}
|
|
|
|
@ -54,23 +73,6 @@ export default function CreateListDialog({
|
|
|
|
|
required={true}
|
|
|
|
|
type="text"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
display="inline"
|
|
|
|
|
label="Cancel"
|
|
|
|
|
size="md"
|
|
|
|
|
variant="tertiary"
|
|
|
|
|
onClick={handleDialogCancel}
|
|
|
|
|
/>
|
|
|
|
|
<Button
|
|
|
|
|
disabled={!isDirty}
|
|
|
|
|
display="inline"
|
|
|
|
|
isLoading={isSubmitting}
|
|
|
|
|
label="Create"
|
|
|
|
|
size="md"
|
|
|
|
|
type="submit"
|
|
|
|
|
variant="primary"
|
|
|
|
|
/>
|
|
|
|
|
</form>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|