Skip to content

Commit f45796a

Browse files
committed
sign up loading icon
1 parent 11a183a commit f45796a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/src/views/auth/SignUp.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
<input type="password" placeholder="Password" v-model="formData.password" class="matcha-input">
3636
<span class="matcha-input-error">{{ passwordErrorHandler(errors[0]) }}</span>
3737
</ValidationProvider>
38-
<input type="submit" :disabled="invalid" value="Sign Up" v-bind:class="{'auth-sub-container-content-submit-button': true, 'opacity-50': invalid, 'cursor-pointer': !invalid}">
38+
<input v-if="!submitted" type="submit" :disabled="invalid" value="Sign Up" v-bind:class="{'auth-sub-container-content-submit-button': true, 'opacity-50': invalid, 'cursor-pointer': !invalid}">
39+
<div v-else class="flex items-center justify-center mt-4">
40+
<img class="h-12" src="../../assets/loading.svg">
41+
</div>
3942
</form>
4043
</ValidationObserver>
4144
</div>
@@ -69,6 +72,7 @@ export default {
6972
happened: false,
7073
message: '',
7174
},
75+
submitted: false,
7276
}),
7377
methods: {
7478
passwordErrorHandler(error) {
@@ -79,11 +83,14 @@ export default {
7983
},
8084
async onSubmit() {
8185
try {
86+
this.submitted = true;
8287
this.clearError();
8388
await this.signUpUser(this.formData);
8489
this.confirmationEmailSent = true;
90+
this.submitted = false;
8591
} catch (error) {
8692
this.displayError(this.$errorMessenger(error));
93+
this.submitted = false;
8794
}
8895
},
8996
async signUpUser(user) {

0 commit comments

Comments
 (0)