Skip to content

Commit

Permalink
WP-38: Prevent multiple clicks to button, add spinner (#819)
Browse files Browse the repository at this point in the history
* disabled after one click; added spinner

* fixed prettier

* using isLoading to handle spinner

* prettier

---------

Co-authored-by: Shayan Khan <shayanaijaz@gmail.com>
Co-authored-by: Sal Tijerina <r.sal.tijerina@gmail.com>
  • Loading branch information
3 people authored Jun 30, 2023
1 parent 85861dd commit 97dc0b5
Showing 1 changed file with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,30 @@ const DataFilesMkdirModal = () => {
validationSchema={validationSchema}
onSubmit={mkdirCallback}
>
<Form>
<ModalHeader toggle={toggle} charCode="&#xe912;">
Creating folder in {systemDisplayName}/{params.path}
</ModalHeader>
<ModalBody>
<FormField
name="dirname"
label="Enter a name for the new folder:"
/>
</ModalBody>
<ModalFooter>
<Button type="primary" size="long" attr="submit">
Create Folder
</Button>
</ModalFooter>
</Form>
{({ isSubmitting }) => (
<Form>
<ModalHeader toggle={toggle} charCode="&#xe912;">
Creating folder in {systemDisplayName}/{params.path}
</ModalHeader>
<ModalBody>
<FormField
name="dirname"
label="Enter a name for the new folder:"
/>
</ModalBody>
<ModalFooter>
<Button
type="primary"
size="long"
attr="submit"
disabled={isSubmitting}
isLoading={isSubmitting}
>
Create Folder
</Button>
</ModalFooter>
</Form>
)}
</Formik>
</Modal>
</>
Expand Down

0 comments on commit 97dc0b5

Please sign in to comment.