feat: add loading state for buttons on settings page (#10643)

* fix: add spinner to general settings section

* feat: add and manage spinner in the emptyScreen component

* feat: add spinner to two-factor auth modal buttons

* feat: add spinner to password and impersonation setting buttons

* feat: add spinner to webhookform(edit and create)

* chore: clean up code

---------

Co-authored-by: lemmyMwaura <[email protected]>
This commit is contained in:
MontoandlemmyMwaura authored and GitHub committed 2023-08-08 19:32:22 +00:00
1 parent 975420181d
commit 59ea4d624b
5 files changed
+24 -5

No files matched your search

@@ -95,7 +95,7 @@ const WebhookForm = (props: {
if (changeSecret) {
formMethods.unregister("secret", { keepDefaultValue: false });
}
}, [changeSecret]);
}, [changeSecret, formMethods]);
return (
<>
@@ -277,7 +277,9 @@ const WebhookForm = (props: {
{...(!props.onCancel ? { href: `${WEBAPP_URL}/settings/developer/webhooks` } : {})}>
{t("cancel")}
</Button>
<Button type="submit" loading={formMethods.formState.isSubmitting}>
<Button
type="submit"
loading={formMethods.formState.isSubmitting || formMethods.formState.isSubmitted}>
{props?.webhook?.id ? t("save") : t("create_webhook")}
</Button>
</DialogFooter>