Merge pull request #269 from restray/restray_registre_loading

feat(auth): add loading on register button
This commit is contained in:
Andras Bacsai 2022-04-02 16:26:57 +02:00 committed by GitHub
commit c47457a17f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,9 @@
emailEl.focus(); emailEl.focus();
}); });
async function handleSubmit() { async function handleSubmit() {
// Prevent double submission
if (loading) return;
if (password !== passwordCheck) { if (password !== passwordCheck) {
return errorNotification('Passwords do not match.'); return errorNotification('Passwords do not match.');
} }
@ -88,8 +91,13 @@
/> />
<div class="flex space-x-2 h-8 items-center justify-center pt-8"> <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" <button
>Register</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> </div>
</form> </form>