Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use material-ui v5 LoadingButton #1658

Open
goto-bus-stop opened this issue Aug 5, 2020 · 1 comment
Open

Use material-ui v5 LoadingButton #1658

goto-bus-stop opened this issue Aug 5, 2020 · 1 comment

Comments

@goto-bus-stop
Copy link
Member

goto-bus-stop commented Aug 5, 2020

For after #1287

We have a couple of places where we manually stick a CircularProgress in a Button when we're waiting for an HTTP request to finish. material-ui v5 has a LoadingButton component, which takes a pending prop for this purpose. It looks a bit better and it can also keep showing the button text while the operation is in progress.

These are the ones I found:

<Button disabled={busy} onClick={this.handleConfirm}>
{busy ? <div className="Button-loading"><CircularProgress size="100%" /></div> : confirmLabel}
</Button>

<Button
className="LoginForm-submit"
disabled={busy}
>
{busy ? (
<div className="Button-loading">
<CircularProgress size="100%" />
</div>
) : t('login.login')}
</Button>

<Button
className="RegisterForm-submit"
disabled={isBusy || !agreed}
>
{isBusy
? <div className="Button-loading"><CircularProgress size="100%" /></div>
: t('login.register')}
</Button>

<Button disabled={busy}>
{busy ? <div className="Button-loading"><CircularProgress size="100%" /></div> : submitLabel}
</Button>

<Button
className="RegisterForm-submit"
disabled={busy || !agreed || !captchaOk}
>
{busy
? <div className="Button-loading"><CircularProgress size="100%" /></div>
: t('login.register')}
</Button>

@Ananyatiwari19
Copy link

If no one has taken up this issue, I would like to pick it up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants