feat: add loading on register button

This commit is contained in:
Restray 2022-04-01 21:41:22 +02:00
parent 986c5b7133
commit 809f40dec9
No known key found for this signature in database
GPG Key ID: 67C6DEF95A4DC812

View File

@ -19,6 +19,9 @@
emailEl.focus();
});
async function handleSubmit() {
// Prevent double submission
if (loading) return;
if (password !== passwordCheck) {
return errorNotification('Passwords do not match.');
}
@ -88,8 +91,13 @@
/>
<div class="flex space-x-2 h-8 items-center justify-center pt-8">
<button type="submit" class="hover:bg-coollabs-100 text-white bg-coollabs"
>Register</button
<button
type="submit"
class="hover:bg-coollabs-100 text-white"
disabled={loading}
class:bg-transparent={loading}
class:text-stone-600={loading}
class:bg-coollabs={!loading}>{loading ? 'Registering...' : 'Register'}</button
>
</div>
</form>